ID) . '" title="Read '.get_the_title($post->ID).'">Read more »'; } add_filter('excerpt_more', 'bones_excerpt_more'); // Adding WP 3+ Functions & Theme Support function bones_theme_support() { add_theme_support('post-thumbnails'); // wp thumbnails (sizes handled in functions.php) set_post_thumbnail_size(125, 125, true); // default thumb size add_theme_support('automatic-feed-links'); // rss thingy // to add header image support go here: http://themble.com/support/adding-header-background-image-support/ // adding post format support add_theme_support( 'menus' ); // wp menus register_nav_menus( // wp3+ menus array( 'main_nav' => 'The Main Menu', // main nav in header 'footer_links' => 'Footer Links' // secondary nav in footer ) ); } // launching this stuff after theme setup add_action('after_setup_theme','bones_theme_support'); // adding sidebars to Wordpress (these are created in functions.php) add_action( 'widgets_init', 'bones_register_sidebars' ); // adding the bones search form (created in functions.php) add_filter( 'get_search_form', 'bones_wpsearch' ); function bones_main_nav() { // display the wp3 menu if available wp_nav_menu( array( 'menu' => 'main_nav', /* menu name */ 'theme_location' => 'main_nav', /* where in the theme it's assigned */ 'container_class' => 'menu clearfix', /* container class */ 'fallback_cb' => 'bones_main_nav_fallback' /* menu fallback */ ) ); } function bones_footer_links() { // display the wp3 menu if available wp_nav_menu( array( 'menu' => 'footer_links', /* menu name */ 'theme_location' => 'footer_links', /* where in the theme it's assigned */ 'container_class' => 'footer-links clearfix', /* container class */ 'fallback_cb' => 'bones_footer_links_fallback' /* menu fallback */ ) ); } // this is the fallback for header menu function bones_main_nav_fallback() { wp_page_menu( 'show_home=Home&menu_class=menu' ); } // this is the fallback for footer menu function bones_footer_links_fallback() { /* you can put a default here if you like */ } /****************** PLUGINS & EXTRA FEATURES **************************/ // Numeric Page Navi (built into the theme by default) function page_navi($before = '', $after = '') { global $wpdb, $wp_query; $request = $wp_query->request; $posts_per_page = intval(get_query_var('posts_per_page')); $paged = intval(get_query_var('paged')); $numposts = $wp_query->found_posts; $max_page = $wp_query->max_num_pages; if ( $numposts <= $posts_per_page ) { return; } if(empty($paged) || $paged == 0) { $paged = 1; } $pages_to_show = 7; $pages_to_show_minus_1 = $pages_to_show-1; $half_page_start = floor($pages_to_show_minus_1/2); $half_page_end = ceil($pages_to_show_minus_1/2); $start_page = $paged - $half_page_start; if($start_page <= 0) { $start_page = 1; } $end_page = $paged + $half_page_end; if(($end_page - $start_page) != $pages_to_show_minus_1) { $end_page = $start_page + $pages_to_show_minus_1; } if($end_page > $max_page) { $start_page = $max_page - $pages_to_show_minus_1; $end_page = $max_page; } if($start_page <= 0) { $start_page = 1; } echo $before.''.$after.""; } // remove the p from around imgs (http://css-tricks.com/snippets/wordpress/remove-paragraph-tags-from-around-images/) function filter_ptags_on_images($content){ return preg_replace('/