Advertisement
ashishsthanp

ColorMag Pro header logo left

Oct 28th, 2020
2,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.21 KB | None | 0 0
  1. function colormag_middle_header_bar_display() {
  2.  
  3.     $screen_reader       = '';
  4.     $description         = get_bloginfo( 'description', 'display' );
  5.     $header_display_type = get_theme_mod( 'colormag_header_logo_placement', 'header_text_only' );
  6.     ?>
  7.  
  8.     <div class="inner-wrap">
  9.         <div id="header-text-nav-wrap" class="clearfix">
  10.  
  11.             <div id="header-left-section">
  12.                 <?php
  13.                 if ( 'show_both' === $header_display_type || 'header_logo_only' === $header_display_type ) {
  14.                     ?>
  15.                     <div id="header-logo-image">
  16.                         <?php
  17.                         if ( function_exists( 'the_custom_logo' ) ) {
  18.                             the_custom_logo();
  19.                         }
  20.                         ?>
  21.                     </div><!-- #header-logo-image -->
  22.                     <?php
  23.                 }
  24.  
  25.                 if ( 'header_logo_only' === $header_display_type || 'disable' === ( $header_display_type ) ) {
  26.                     $screen_reader = 'screen-reader-text';
  27.                 }
  28.                 ?>
  29.  
  30.                 <div id="header-text" class="<?php echo esc_attr( $screen_reader ); ?>">
  31.                     <?php if ( is_front_page() || is_home() ) : ?>
  32.                         <h1 id="site-title"<?php echo colormag_schema_markup( 'site-title' ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>>
  33.                             <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
  34.                         </h1>
  35.                     <?php else : ?>
  36.                         <h3 id="site-title"<?php echo colormag_schema_markup( 'site-title' ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>>
  37.                             <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
  38.                         </h3>
  39.                     <?php endif; ?>
  40.  
  41.                     <?php
  42.                     if ( $description || is_customize_preview() ) :
  43.                         ?>
  44.                         <p id="site-description"<?php echo colormag_schema_markup( 'site-description' ); // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>>
  45.                             <?php echo $description; // phpcs:ignore WordPress.XSS.EscapeOutput.OutputNotEscaped ?>
  46.                         </p><!-- #site-description -->
  47.                     <?php endif; ?>
  48.                 </div><!-- #header-text -->
  49.             </div><!-- #header-left-section -->
  50.  
  51.             <div id="header-right-section">
  52.                 <?php
  53.                 if ( is_active_sidebar( 'colormag_header_sidebar' ) ) {
  54.                     ?>
  55.                     <div id="header-right-sidebar" class="clearfix">
  56.                         <?php dynamic_sidebar( 'colormag_header_sidebar' ); ?>
  57.                     </div>
  58.                     <?php
  59.                 }
  60.                 ?>
  61.             </div><!-- #header-right-section -->
  62.  
  63.             <?php colormag_below_header_bar_display(); ?>
  64.  
  65.         </div><!-- #header-text-nav-wrap -->
  66.     </div><!-- .inner-wrap -->
  67.  
  68.     <?php
  69.  
  70. }
  71.  
  72. function colormag_header() {
  73.  
  74.     $header_layout         = get_theme_mod( 'colormag_main_total_header_area_display_type', 'type_one' );
  75.     $header_image_position = get_theme_mod( 'colormag_header_image_position', 'position_two' );
  76.  
  77.     if ( 'type_one' === $header_layout || 'type_two' === $header_layout || 'type_three' === $header_layout ) :
  78.  
  79.         // Display the top header bar.
  80.         colormag_top_header_bar_display();
  81.  
  82.         if ( 'position_one' === $header_image_position ) {
  83.             the_custom_header_markup();
  84.         }
  85.  
  86.         // Display the middle header bar.
  87.         colormag_middle_header_bar_display();
  88.  
  89.         if ( 'position_two' === $header_image_position ) :
  90.             the_custom_header_markup();
  91.         endif;
  92.  
  93.     elseif ( 'type_four' === $header_layout || 'type_six' === $header_layout ) :
  94.  
  95.         // Display the top header bar.
  96.         colormag_top_header_bar_display();
  97.  
  98.         // Display the below header bar.
  99.         colormag_below_header_bar_display();
  100.  
  101.         if ( 'position_one' === $header_image_position || 'position_two' === $header_image_position || 'position_three' === $header_image_position ) {
  102.             the_custom_header_markup();
  103.         }
  104.  
  105.         // Display the middle header bar.
  106.         colormag_middle_header_bar_display();
  107.  
  108.     elseif ( 'type_five' === $header_layout ) :
  109.  
  110.         // Display the below header bar.
  111.         colormag_below_header_bar_display();
  112.  
  113.         if ( 'position_three' === $header_image_position ) {
  114.             the_custom_header_markup();
  115.         }
  116.  
  117.         // Display the top header bar.
  118.         colormag_top_header_bar_display();
  119.  
  120.         if ( 'position_one' === $header_image_position || 'position_two' === $header_image_position ) {
  121.             the_custom_header_markup();
  122.         }
  123.  
  124.         // Display the middle header bar.
  125.         colormag_middle_header_bar_display();
  126.  
  127.     endif;
  128.  
  129. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement