Advertisement
kaed

header.php - 7/26/13

Jul 26th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.67 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The Header for our theme.
  4.  *
  5.  * Displays all of the <head> section and everything up till <div id="main">
  6.  *
  7.  * @package b4b
  8.  */
  9. ?><!DOCTYPE html>
  10. <html <?php language_attributes(); ?>>
  11. <head>
  12. <meta charset="<?php bloginfo( 'charset' ); ?>" />
  13. <meta name="viewport" content="width=device-width" />
  14. <title><?php wp_title( '|', true, 'right' ); ?></title>
  15. <link rel="profile" href="http://gmpg.org/xfn/11" />
  16. <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
  17.  
  18. <?php wp_head(); ?>
  19. </head>
  20.  
  21. <body <?php body_class(); ?>>
  22. <div id="page" class="hfeed site">
  23.     <?php do_action( 'before' ); ?>
  24.     <header id="masthead" class="site-header" role="banner">
  25.         <?php $display_options = get_option( 'b4b_theme_display_options' ); ?>
  26.         <div class="site-branding">
  27.             <?php if (sanitize_text_field($display_options['header_type']) == 'image'){ ?>
  28.                
  29.                 <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
  30.                     <img src="<?php echo esc_url($display_options['header_image']); ?>" alt="logo" />
  31.                 </a>
  32.                
  33.             <?php } elseif(sanitize_text_field($display_options['header_type']) == 'text' && sanitize_title($display_options['header_title']) == '' && sanitize_text_field($display_options['header_slogan']) == '') { ?>
  34.            
  35.                 <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
  36.                 <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
  37.                
  38.             <?php } elseif(sanitize_text_field($display_options['header_type']) == 'text' && sanitize_title($display_options['header_title']) != '' && sanitize_text_field($display_options['header_slogan']) != '') { ?>
  39.            
  40.                 <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( sanitize_title($display_options['header_title']) ); ?>" rel="home"><?php echo esc_attr( sanitize_title($display_options['header_title']) ); ?></a></h1>
  41.                 <h2 class="site-description"><?php echo esc_attr( sanitize_text_field($display_options['header_slogan']) ); ?></h2>
  42.                
  43.             <?php } ?>
  44.         </div>
  45.  
  46.         <nav id="site-navigation" class="navigation-main" role="navigation">
  47.             <h1 class="menu-toggle"><?php _e( 'Menu', 'b4b' ); ?></h1>
  48.             <div class="screen-reader-text skip-link"><a href="#content" title="<?php esc_attr_e( 'Skip to content', 'b4b' ); ?>"><?php _e( 'Skip to content', 'b4b' ); ?></a></div>
  49.  
  50.             <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
  51.         </nav><!-- #site-navigation -->
  52.     </header><!-- #masthead -->
  53.  
  54.     <div id="main" class="site-main">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement