Advertisement
srikat

functions.php

Sep 23rd, 2014
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. /**********************************
  2. *
  3. * Replace Header Site Title with Inline Logo
  4. * Fix Genesis bug - when using static front page and blog page (admin reading settings) Home page is <p> tag and Blog page is <h1> tag
  5. * Replace "is_home" with "is_front_page" to correctly display Home page wit <h1> tag and Blog page with <p> tag
  6. *
  7. * @author AlphaBlossom / Tony Eppright
  8. * @link http://www.alphablossom.com
  9. *
  10. ************************************/
  11. add_filter( 'genesis_seo_title', 'abte_header_inline_logo', 10, 3 );
  12. function abte_header_inline_logo( $title, $inside, $wrap ) {
  13.  
  14. $logo = '<img src="' . get_stylesheet_directory_uri() . '/images/euroblend-logo.png" alt="' . esc_attr( get_bloginfo( 'name' ) ) . '">';
  15.  
  16. $inside = sprintf( '<a href="%s" title="%s">%s</a>', trailingslashit( home_url() ), esc_attr( get_bloginfo( 'name' ) ), $logo );
  17.  
  18. //* Determine which wrapping tags to use - changed is_home to is_front_page to fix Genesis bug
  19. $wrap = is_front_page() && 'title' === genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : 'p';
  20.  
  21. //* A little fallback, in case an SEO plugin is active - changed is_home to is_front_page to fix Genesis bug
  22. $wrap = is_front_page() && ! genesis_get_seo_option( 'home_h1_on' ) ? 'h1' : $wrap;
  23.  
  24. //* And finally, $wrap in h1 if HTML5 & semantic headings enabled
  25. $wrap = genesis_html5() && genesis_get_seo_option( 'semantic_headings' ) ? 'h1' : $wrap;
  26.  
  27. return sprintf( '<%1$s %2$s>%3$s</%1$s>', $wrap, genesis_attr( 'site-title' ), $inside );
  28.  
  29. }
  30.  
  31. //* Remove the site description
  32. remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
  33.  
  34. //* Unregister primary navigation menu
  35. add_theme_support( 'genesis-menus', array( 'secondary' => __( 'Secondary Navigation Menu', 'genesis' ) ) );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement