• Resolved Geri70

    (@geri70)


    Hi!

    I’m using this theme and I love it!

    I like the possibility to make a full width header,
    but want to ask if it’s possible to disable it in the single post…?

    Thnx in advance
    Geri (https://www.geri.at)

Viewing 1 replies (of 1 total)
  • Hi @geri70

    Yes it’s possible to disable header in the single post.
    1. For this you need to create child theme.Reference here for child theme
    2. Now in child theme’s folder function.php file copy and paste following code:

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
       wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }
    
    function photo_perfect_add_custom_header(){
    
       if ( ! get_header_image() ) {
         return;
       }
    
       if(!is_single()){?>
    
       <div id="featured-banner" class="featured-banner">
         <div class="item">
           <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
             <img src="<?php header_image(); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" height="<?php echo esc_attr( get_custom_header()->height ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>">
           </a>
         </div><!-- .item -->
       </div><!-- #featured-banner -->
       <?php
    
       }
    
     }
    
    add_action( 'photo_perfect_action_after_header', 'photo_perfect_add_custom_header', 15 );

    3. Now activate the child theme and by now your problem should be solved.
    4. But the issue with this would be the arrow will lie behind the main Menu and arrow will be disabled.Check Here.
    Note: Please customize files of child theme, so your changes will not overwrite on theme update.

    Thanks and Cheers!!

Viewing 1 replies (of 1 total)
  • The topic ‘disable header at the single post’ is closed to new replies.