Advertisement
catchmahesh

Inline Site title and Header text - Catch Adaptive

Apr 4th, 2016
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.53 KB | None | 0 0
  1. function catchadaptive_site_branding() {
  2.     $options            = catchadaptive_get_theme_options();
  3.  
  4.     $logo_alt = ( '' != $options['logo_alt_text'] ) ? $options['logo_alt_text'] : get_bloginfo( 'name', 'display' );
  5.  
  6.     $catchadaptive_site_logo = '';
  7.     //Checking Logo
  8.     if ( function_exists( 'has_custom_logo' ) ) {
  9.         if ( has_custom_logo() ) {
  10.             $catchadaptive_site_logo = get_custom_logo();
  11.         }
  12.     }
  13.     else if ( '' != $options['logo'] && !$options['logo_disable'] ) {
  14.         //@remove Remove this else if block when WordPress 4.8 is released
  15.         $catchadaptive_site_logo = '
  16.  
  17.             <a href="' . esc_url( home_url( '/' ) ) . '" title="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '" rel="home">
  18.                 <img src="' . esc_url( $options['logo'] ) . '" alt="' . esc_attr(  $logo_alt ). '">
  19.             </a>';
  20.         //</div><!-- #site-logo -->';
  21.     }
  22.  
  23.     if ( display_header_text() ){
  24.         // Show header text if display_header_text is checked
  25.         $catchadaptive_header_text = '
  26.         <div id="site-header">
  27.             <h1 class="site-title"><a href="' . esc_url( home_url( '/' ) ) . '">' . get_bloginfo( 'name' ) . '</a></h1>
  28.             <h2 class="site-description">' . get_bloginfo( 'description' ) . '</h2>
  29.         </div><!-- #site-header -->';
  30.     }
  31.     else {
  32.         $catchadaptive_header_text = '';
  33.     }
  34.  
  35.     $catchadaptive_site_branding    = '<div id="site-branding">';
  36.     $catchadaptive_site_branding    .= $catchadaptive_header_text;
  37.  
  38.     if ( function_exists( 'has_custom_logo' ) ) {
  39.         if ( has_custom_logo() ) {
  40.             if ( ! $options['move_title_tagline'] ) {
  41.                 $catchadaptive_site_branding  = '<div id="site-branding" class="logo-left">';
  42.                 $catchadaptive_site_branding .= $catchadaptive_site_logo;
  43.                 $catchadaptive_site_branding .= $catchadaptive_header_text;
  44.             }
  45.             else {
  46.                 $catchadaptive_site_branding  = '<div id="site-branding" class="logo-right">';
  47.                 $catchadaptive_site_branding .= $catchadaptive_header_text;
  48.                 $catchadaptive_site_branding .= $catchadaptive_site_logo;
  49.             }
  50.         }
  51.     }
  52.     else if ( '' != $options['logo'] && !$options['logo_disable'] ) {
  53.         if( ! $options['move_title_tagline'] ) {
  54.             $catchadaptive_site_branding  = '<div id="site-branding">';
  55.             $catchadaptive_site_branding .= $catchadaptive_site_logo;
  56.             $catchadaptive_site_branding .= $catchadaptive_header_text;
  57.         }
  58.         else {
  59.             $catchadaptive_site_branding  = '<div id="site-branding">';
  60.             $catchadaptive_site_branding .= $catchadaptive_header_text;
  61.             $catchadaptive_site_branding .= $catchadaptive_site_logo;
  62.         }
  63.     }
  64.  
  65.     $catchadaptive_site_branding    .= '</div><!-- #site-branding-->';
  66.  
  67.     echo $catchadaptive_site_branding ;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement