' . "\n"; $doctype .= '' . "\n"; echo apply_filters( 'hybrid_doctype', $doctype ); } /** * Shows the content type in the header. Gets the site's defined HTML type * and charset. Can be overwritten with the hybrid_meta_content_type filter. * * @since 0.4 */ function hybrid_meta_content_type() { $content_type = '' . "\n"; echo apply_filters( 'hybrid_meta_content_type', $content_type ); } /** * Allows/disallows indexing by search engines. Calls theme settings to check * for data. Check options 'blog_public' for privacy mode. If private, don't * send meta info to header. Runs the hybrid_meta_robots filter hook at the end. * * @since 0.2.3 */ function hybrid_meta_robots() { global $hybrid_settings; if ( !get_option( 'blog_public' ) ) return; /* Indexing/Robots according to current page. */ if ( ( is_home() || is_front_page() ) && ( $hybrid_settings['robots_home'] ) ) $follow = true; elseif ( is_attachment() && $hybrid_settings['robots_attachment'] ) $follow = true; elseif ( is_single() && !is_attachment() && $hybrid_settings['robots_single'] ) $follow = true; elseif ( is_page() && !is_front_page() && $hybrid_settings['robots_page'] ) $follow = true; elseif ( is_date() && $hybrid_settings['robots_date'] ) $follow = true; elseif ( is_category() && $hybrid_settings['robots_category'] ) $follow = true; elseif ( is_tag() && $hybrid_settings['robots_tag'] ) $follow = true; elseif ( is_tax() && $hybrid_settings['robots_tax'] ) $follow = true; elseif ( is_search() && $hybrid_settings['robots_search'] ) $follow = true; elseif ( is_author() && $hybrid_settings['robots_author'] ) $follow = true; elseif ( is_404() && $hybrid_settings['robots_404'] ) $follow = true; else $follow = false; /* Format the output of meta robots. */ if ( $follow ) $robots = '' . "\n"; else $robots = '' . "\n"; echo apply_filters( 'hybrid_meta_robots', $robots ); } /** * Meta abstract tag. Should only be used with highly specialized fields. * Good for research papers and studies but will not help/hurt SEO. * Input 10 words or less. Users should use the custom field key 'Abstract'. * * @since 0.4 */ function hybrid_meta_abstract() { global $post; $abstract = get_post_meta( $post->ID, 'Abstract', $single = true ); if ( $abstract ) echo '' . "\n"; } /** * Generates the meta author. On single posts and pages, use the author's name. * On the home page, use all authors. The hybrid_meta_author filter added in 0.6. * * @since 0.3.3 */ function hybrid_meta_author() { global $wp_query, $hybrid_settings; if ( is_home() && $hybrid_settings['seo_meta_author_home'] ) $author = wp_list_authors( array( 'html' => false, 'style' => 'none', 'hide_empty' => true, 'show_fullname' => true, 'exclude_admin' => false, 'echo' => false ) ); elseif ( is_singular() && $hybrid_settings['seo_meta_author'] ) $author = get_the_author_meta( 'display_name', $wp_query->post->post_author ); if ( $author ) $author = '' . "\n"; echo apply_filters( 'hybrid_meta_author', $author ); } /** * Add the meta tag for copyright information to the header. Single * posts and pages should display the date written. All other pages will * show the current year. The hybrid_meta_copyright filter added in 0.6. * * @since 0.4 */ function hybrid_meta_copyright() { if ( is_singular() ) $date = get_the_time( __('F Y', 'hybrid') ); else $date = date( __('Y', 'hybrid') ); $copyright = '' . "\n"; echo apply_filters( 'hybrid_meta_copyright', $copyright ); } /** * Add the revised meta tag on single posts and pages. This shows the * last time the post/page was modified. The hybrid_meta_revised filter * added in 0.6. * * @since 0.4 */ function hybrid_meta_revised() { if ( is_singular() ) $revised = '' . "\n"; echo apply_filters( 'hybrid_meta_revised', $revised ); } /** * Generates the meta description. Checks theme settings for indexing, title, * and meta settings. Customize this with the hybrid_meta_description filter. * * @since 0.2.3 */ function hybrid_meta_description() { global $post, $hybrid_settings; if ( !is_array( $hybrid_settings['seo_tax_archive'] ) ) $hybrid_settings['seo_tax_archive'] = array(); /* Get the meta description according to current page. */ if ( is_home() ) $meta_desc = get_bloginfo( 'description' ); elseif ( is_singular() && !is_attachment() ) $meta_desc = get_post_meta( $post->ID, 'Description', true ); elseif ( is_author() ) $meta_desc = get_the_author_meta( 'description', get_query_var( 'author' ) ); elseif ( is_category() && in_array( 'category', $hybrid_settings['seo_tax_archive'] ) ) $meta_desc = stripslashes( strip_tags( category_description() ) ); elseif ( is_tag() && in_array( 'post_tag', $hybrid_settings['seo_tax_archive'] ) ) $meta_desc = stripslashes( strip_tags( tag_description() ) ); elseif ( is_tax() && in_array( get_query_var( 'taxonomy' ), $hybrid_settings['seo_tax_archive'] ) ) $meta_desc = stripslashes( strip_tags( term_description( '', get_query_var( 'taxonomy' ) ) ) ); /* If nothing for the front page or single posts, grab the defaults. */ if ( is_single() && !$meta_desc && $hybrid_settings['seo_single_excerpts'] ) $meta_desc = get_the_excerpt(); elseif ( is_front_page() && !$meta_desc ) $meta_desc = get_bloginfo( 'description' ); /* Format the meta description. */ if ( $meta_desc || strlen( $meta_desc ) >= 1 ) $meta_desc = '' . "\n"; echo apply_filters( 'hybrid_meta_description', $meta_desc ); } /** * Generates meta keywords/tags for the site. Checks theme settings. * Checks indexing settings. Customize with the hybrid_meta_keywords filter. * * @since 0.2.3 */ function hybrid_meta_keywords() { global $post, $hybrid_settings, $wp_query; /* If on a single post, check for custom field key Keywords and taxonomies. */ if ( is_singular() && !is_preview() && !is_attachment() ) $keywords = get_post_meta( $post->ID, 'Keywords', true ); if ( is_single() && !is_attachment() && empty( $keywords ) && is_array( $hybrid_settings['seo_single_tax'] ) ) { foreach( $hybrid_settings['seo_single_tax'] as $single_tax ) { $terms = get_the_term_list( $wp_query->post->ID, $single_tax, '', ', ', '' ); if ( $terms ) $keywords[] = $terms; } if ( !empty( $keywords ) ) $keywords = join( ', ', $keywords ); } elseif ( is_page() && empty( $keywords ) && is_array( $hybrid_settings['seo_page_tax'] ) ) { foreach( $hybrid_settings['seo_page_tax'] as $page_tax ) { $terms = get_the_term_list( $wp_query->post->ID, $page_tax, '', ', ', '' ); if ( $terms ) $keywords[] = $terms; } if ( !empty( $keywords ) ) $keywords = join( ', ', $keywords ); } /* If we have keywords, join them together into one string and format for output. */ if ( !empty( $keywords ) ) $keywords = '' . "\n"; echo apply_filters( 'hybrid_meta_keywords', $keywords ); } /** * Generates the relevant template info. Adds template meta with * theme version. Uses the theme name and version from style.css. * In 0.6, added the hybrid_meta_template filter hook. * * @since 0.4 */ function hybrid_meta_template() { $data = get_theme_data( TEMPLATEPATH . '/style.css' ); $template = '' . "\n"; echo apply_filters( 'hybrid_meta_template', $template ); } /** * Checks for a user-uploaded favicon. Looks in the child theme's * /images folder. Customize with the hybrid_favicon filter. * * @since 0.4 */ function hybrid_favicon() { if ( file_exists( HYBRID_CHILD_DIR . '/images/favicon.ico' ) ) $favicon = '' . "\n"; echo apply_filters( 'hybrid_favicon', $favicon ); } /** * Display pingback info in . * @uses get_bloginfo() Gets the pingback URL. * @link http://codex.wordpress.org/Template_Tags/get_bloginfo * * @since 0.4 */ function hybrid_head_pingback() { $pingback = '' . "\n"; echo apply_filters( 'hybrid_head_pingback', $pingback ); } /** * Adds to . This is a marker for search * engines to recognize the correct URL. Helps by reducing duplicate * content issues. Use the hybrid_head_canonical filter to customize. * * @since 0.5 */ function hybrid_head_canonical() { if ( is_singular() ) $canonical = '' . "\n"; echo apply_filters( 'hybrid_head_canonical', $canonical ) . "\n"; } /** * Archived and single navigation links. See the navigation-links.php file * located in the root Hybrid directory. * @uses locate_template() Checks for template in child and parent theme. * * @since 0.2 */ function hybrid_navigation_links() { locate_template( array( 'navigation-links.php' ), true ); } /** * Footer insert from the theme settings page. * @uses stripslashes() for proper output of code. * @uses do_shortcode Added in 0.6 to allow footer shortcodes. * @link http://codex.wordpress.org/Shortcode_API * * @since 0.2.1 */ function hybrid_footer_insert() { global $hybrid_settings; echo do_shortcode( stripslashes( $hybrid_settings['footer_insert'] ) ); } /** * Gets legacy functions if user needs them. Adds functions or * classes needed for older versions of WP. * * @internal Prior to 0.5, this handled WP 2.5 - 2.6. * @internal Prior to 0.6, this handled WP 2.6. * @internal In 0.6, support for WP versions prior to 2.8 was dropped. * The function will remain as it'll likely be used in future versions. * * @since 0.3 */ function hybrid_legacy_functions() { return ''; } /** * Error output message. Shouldn't be used much, but just in case, it's here. * * @since 0.2 * @return string */ function hybrid_error() { _e('You have encountered an error. This is usually because you\'ve changed something in the core Hybrid theme files. Try undoing your last edit to correct this issue. If this doesn\'t resolve it, head over to the support forums for help.', 'hybrid'); } ?>