Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6244475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:19:56+00:00 2026-05-24T12:19:56+00:00

i need some suggestions to simplifying or even optimizing the following WordPress Theme Functions.

  • 0

i need some suggestions to simplifying or even optimizing the following WordPress Theme Functions.

The first one removes some Theme features and Default WordPress Header stuff i don’t nedd. The Second adds some Javascript and CSS Files, but only if the user are not an Admin.

<?php

add_action('after_setup_theme', 'remove_theme_features', 11 );

function remove_theme_features() {
   $GLOBALS['custom_background']   = 'kill_theme_features';
   $GLOBALS['custom_image_header'] = 'kill_theme_features';
   remove_theme_support('post-formats');    
   remove_action( 'wp_head', 'feed_links_extra', 3 ); // Display the links to the extra feeds such as category feeds
   remove_action( 'wp_head', 'feed_links', 2 ); // Display the links to the general feeds: Post and Comment Feed
   remove_action( 'wp_head', 'rsd_link' ); // Display the link to the Really Simple Discovery service endpoint, EditURI link
   remove_action( 'wp_head', 'wlwmanifest_link' ); // Display the link to the Windows Live Writer manifest file.
   remove_action( 'wp_head', 'index_rel_link' ); // index link
   remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // prev link
   remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // start link
   remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); // Display relational links for the posts adjacent to the current post.
   remove_action( 'wp_head', 'wp_generator' ); // Display the XHTML generator that is generated on the wp_head hook, WP version
}

class kill_theme_features {
   function init() { return false; }
}


if ( !is_admin() ) {
   add_action('init', 'hno_init_js');
   function hno_init_js() {        
       wp_enqueue_script('carousel', get_bloginfo('stylesheet_directory') . '/js/carousel/jquery.jcarousel.min.js', array('jquery'), '1', true);
       wp_enqueue_script('history', get_bloginfo('stylesheet_directory') . '/js/carousel/jquery.history.min.js', array('jquery'), '1', true);
       wp_enqueue_script('galleria', get_bloginfo('stylesheet_directory') . '/js/carousel/jquery.galleria.min.js', array('jquery'), '1', true);
       wp_enqueue_script('fancybox_js', get_bloginfo('stylesheet_directory') . '/js/fancybox/jquery.fancybox-1.3.4.pack.js', array('jquery'), '1', true);
       wp_enqueue_script('hno', get_bloginfo('stylesheet_directory') . '/js/hno.js', array('jquery'), '1', true);
   }

   wp_enqueue_style('carousel_css', get_bloginfo('stylesheet_directory') . '/js/carousel/tango/skin.css', array() , false , 'screen' );
   wp_enqueue_style('fancybox_css', get_bloginfo('stylesheet_directory') . '/js/fancybox/jquery.fancybox-1.3.4.css', array() , false , 'screen' );
}
?>

Thank you very much!

Regards Steve

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:19:57+00:00Added an answer on May 24, 2026 at 12:19 pm

    Head cleaner is the plugin i use to do all this for me!

    I just drop in all my js and css into the head in the standard way, then play around with the functions of head cleaner until I have nice, streamlined code.

    http://wordpress.org/extend/plugins/head-cleaner/

    not affiliated in any way btw!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i need some suggestions first, My application is like, on main screen a user
Can any one help me out with some suggestions... In my application i need
I need to draw some simple network topology charts, suggestions of some good tools
I need some suggestions to implement a business rule - whether to keep it
I need some suggestions as to whether my idea is ok or not. I
I need some suggestions for how to implement a very basic mechanism that logs
I use Linux as primary OS. I need some suggestions regarding how should I
Need some guidance and ideally some first-hand experience. We committed to a php framework
I need some suggestions on how to fetch dynamically generated files via jobs running
I need some suggestions in the database design schema I've created below... I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.