widgets['WP_Widget_Recent_Comments'])) { remove_action('wp_head', array($wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style')); } } // remove injected CSS from gallery function bones_gallery_style($css) { return preg_replace("!!s", '', $css); } /********************* SCRIPTS & ENQEUEING *********************/ // loading modernizr and jquery, and reply script function bones_scripts_and_styles() { if (!is_admin()) { // modernizr (without media query polyfill) wp_register_script( 'bones-modernizr', get_template_directory_uri() . '/library/js/libs/modernizr.custom.min.js', array(), '2.5.3', false ); // register mobile stylesheet wp_register_style( 'bones-stylesheet', get_template_directory_uri() . '/library/css/style.css', array(), '', 'all' ); // comment reply script for threaded comments if ( is_singular() AND comments_open() AND (get_option('thread_comments') == 1)) { wp_enqueue_script( 'comment-reply' ); } //adding scripts file in the footer wp_register_script( 'bones-js', get_template_directory_uri() . '/library/js/scripts.js', array( 'jquery' ), '', true ); // enqueue styles and scripts wp_enqueue_script( 'bones-modernizr' ); wp_enqueue_style( 'bones-stylesheet' ); /* I reccomend using a plugin to call jQuery using the google cdn. That way it stays cached and your site will load faster. */ wp_enqueue_script( 'jquery' ); wp_enqueue_script( 'bones-js' ); } } /********************* THEME SUPPORT *********************/ // Adding WP 3+ Functions & Theme Support function bones_theme_support() { // wp thumbnails (sizes handled in functions.php) add_theme_support('post-thumbnails'); // default thumb size set_post_thumbnail_size(125, 125, true); // wp custom background (thx to @bransonwerner for update) add_theme_support( 'custom-background', array( 'default-image' => '', // background image default 'default-color' => '', // background color default (dont add the #) 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ) ); // rss thingy add_theme_support('automatic-feed-links'); // to add header image support go here: http://themble.com/support/adding-header-background-image-support/ // adding post format support add_theme_support( 'post-formats', array( 'aside', // title less blurb 'gallery', // gallery of images 'link', // quick link to other site 'image', // an image 'quote', // a quick quote 'status', // a Facebook like status update 'video', // video 'audio', // audio 'chat' // chat transcript ) ); // wp menus add_theme_support( 'menus' ); // registering wp3+ menus register_nav_menus( array( 'main_nav' => 'The Main Menu', // main nav in header 'footer_links' => 'Footer Links' // secondary nav in footer ) ); } /* end bones theme support */ /********************* MENUS & NAVIGATION *********************/ // the main menu function bones_main_nav() { // display the wp3 menu if available wp_nav_menu(array( 'container' => false, // remove nav container 'container_class' => 'menu clearfix', // class of container (should you choose to use it) 'menu' => 'main_nav', // nav name 'menu_class' => 'nav top-nav clearfix', // adding custom nav class 'theme_location' => 'main_nav', // where it's located in the theme 'before' => '', // before the menu 'after' => '', // after the menu 'link_before' => '', // before each link 'link_after' => '', // after each link 'depth' => 0, // limit the depth of the nav 'fallback_cb' => 'bones_main_nav_fallback' // fallback function )); } /* end bones main nav */ // the footer menu (should you choose to use one) function bones_footer_links() { // display the wp3 menu if available wp_nav_menu(array( 'container' => '', // remove nav container 'container_class' => 'footer-links clearfix', // class of container (should you choose to use it) 'menu' => 'footer_links', // nav name 'menu_class' => 'nav footer-nav clearfix', // adding custom nav class 'theme_location' => 'footer_links', // where it's located in the theme 'before' => '', // before the menu 'after' => '', // after the menu 'link_before' => '', // before each link 'link_after' => '', // after each link 'depth' => 0, // limit the depth of the nav 'fallback_cb' => 'bones_footer_links_fallback' // fallback function )); } /* end bones footer link */ // this is the fallback for header menu function bones_main_nav_fallback() { wp_page_menu( 'show_home=Home' ); } // this is the fallback for footer menu function bones_footer_links_fallback() { /* you can put a default here if you like */ } /********************* RELATED POSTS FUNCTION *********************/ // Related Posts Function (call using bones_related_posts(); ) function bones_related_posts() { echo '