i want a few recommendations to simplifying as well as optimizing the next WordPress Theme Functions.

The first removes some Theme features and Default Wordpress Header stuff i do not nedd. The 2nd adds some Javascript and CSS Files, but only when the consumer aren't an Admin.


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_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' );

Thanks greatly!

Regards Steve

Mind cleaner may be the wordpress plugin i personally use to complete all of this for me personally!

I simply drop in most my js and css in to the mind within the standard way, then adjust the functions of mind cleaner until I've nice, sleek code.


not affiliated by any means btw!