_body_class( $classes ) { global $is_gecko, $is_IE, $is_opera, $is_safari, $is_chrome; if( $is_gecko ) $classes[] = 'gecko'; elseif( $is_opera ) $classes[] = 'opera'; elseif( $is_safari ) $classes[] = 'safari'; elseif( $is_lynx ) $classes[] = 'lynx'; elseif( $is_chrome ) $classes[] = 'chrome'; elseif( $is_NS4 ) $classes[] = 'ns4'; elseif( $is_IE ) $classes[] = 'ie'; else $classes[] = 'unknown-browser'; if( $is_iphone ) $classes[] = 'iphone'; if( is_singular() ) { global $post; foreach( ( get_the_category( $post->ID ) ) as $category ) { $classes[] = 'term-' . $category->category_nicename; } $classes[] = 'singular'; } if( is_multi_author() ) { $classes[] = 'group-blog'; } if( is_archive() || is_search() || is_home() ) { $classes[] = 'list-view'; } return $classes; } add_filter( 'body_class', '<%= theme_id %>_body_class' ); /** * Remove generator */ function <%= theme_id %>_cleanup_head() { remove_action('wp_head', 'feed_links', 2); remove_action('wp_head', 'feed_links_extra', 3); remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); } add_action( 'init', '<%= theme_id %>_cleanup_head' ); /** * WP title */ function <%= theme_id %>_wp_title( $title, $sep ) { global $paged, $page; if ( is_feed() ) { return $title; } // Add the site name. $title .= get_bloginfo( 'name' ); // Add the site description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) { $title = "$title $sep $site_description"; } // Add a page number if necessary. if ( $paged >= 2 ) { $title = "$title $sep " . sprintf( __( 'Page %s', '<%= theme_id %>' ), max( $paged, $page ) ); } return $title; } add_filter( 'wp_title', '<%= theme_id %>_wp_title', 10, 2 ); /** * Nav object classes */ function <%= theme_id %>_add_extra_menu_classes( $objects ) { $objects[1]->classes[] = 'first'; $objects[count( $objects )]->classes[] = 'last'; return $objects; } add_filter( 'wp_nav_menu_objects', '<%= theme_id %>_add_extra_menu_classes' ); /** * Add favicon */ function <%= theme_id %>_favicon() { echo ''; } add_action( 'wp_head', '<%= theme_id %>_favicon' );