pete-

customphp

May 19th, 2016
15
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if ( ! function_exists( 'generate_header_items' ) ) :
  2. /**
  3. * Build the header
  4. *
  5. * Wrapping this into a function allows us to customize the order in a child theme
  6. *
  7. * @since 1.2.9.7
  8. */
  9. function generate_header_items()
  10. {
  11. $generate_settings = wp_parse_args(
  12. get_option( 'generate_settings', array() ),
  13. generate_get_defaults()
  14. );
  15.  
  16. // Get the title and tagline
  17. $title = get_bloginfo( 'title' );
  18. $tagline = get_bloginfo( 'description' );
  19.  
  20. // If the disable title checkbox is checked, or the title field is empty, return true
  21. $disable_title = ( '1' == $generate_settings[ 'hide_title' ] || '' == $title ) ? true : false;
  22.  
  23. // If the disable tagline checkbox is checked, or the tagline field is empty, return true
  24. $disable_tagline = ( '1' == $generate_settings[ 'hide_tagline' ] || '' == $tagline ) ? true : false;
  25.  
  26. // Header widget
  27. if ( is_active_sidebar('header') ) : ?>
  28. <div class="header-widget">
  29. <?php dynamic_sidebar( 'header' ); ?>
  30. </div>
  31. <?php endif;
  32.  
  33. // Site logo
  34. if ( ! empty( $generate_settings['logo'] ) ) : ?>
  35. <div class="site-logo">
  36. <a href="<?php echo apply_filters( 'generate_logo_href' , esc_url( home_url( '/' ) ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><img class="header-image" src="<?php echo esc_url( $generate_settings['logo'] ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" /></a>
  37. </div>
  38. <?php endif;
  39.  
  40. // Site title and tagline
  41. if ( false == $disable_title || false == $disable_tagline ) : ?>
  42. <div class="site-branding">
  43. <?php if ( false == $disable_title ) : ?>
  44. <p class="main-title" itemprop="headline"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></p>
  45. <?php endif;
  46.  
  47. if ( false == $disable_tagline ) : ?>
  48. <p class="site-description"><?php echo html_entity_decode( bloginfo( 'description' ) ); ?></p>
  49. <?php endif; ?>
  50. </div>
  51. <?php endif;
  52. }
  53. endif;
  54.  
  55. add_filter ( 'generate_mobile_menu_label','generate_custom_mobile_menu_label' );
  56. function generate_custom_mobile_menu_label()
  57. {
  58. return 'Valikko';
  59. }
RAW Paste Data