Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Header element disable

  • Hi, we are trying to disable the header for some pages but selecting Header in Disable Elements section not working.

    Disable elements for content title, and footer working fine.

    We have created custom header and footer using elements.

    Thanks
    Julash

  • Hi there,

    The option only works for the default header, unfortunately.

    You can exclude the pages for the block element – site header, so the pages are using the default site header, then you can use the layout element to disable them on those pages.

  • Is there no other way? Our marketing team creates new pages every now and then to run various promotions. So it will be troublesome to exclude every new page from the header element.

    I guess there always CSS.

  • How do you define a page with or without header?

  • Followed the steps mentioned here https://generatepress.com/forums/topic/can-not-find-template-in-pages-attributes/#post-2306945 and created the below page template for my requirements:

    
    <?php
    /**
     * Template Name: Page Blank
     * Template Post Type: page
     * @package GeneratePress
     */
    
    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly.
    }
    ?>
    <!DOCTYPE html>
    <html <?php language_attributes(); ?>>
    <head>
    	<meta charset="<?php bloginfo( 'charset' ); ?>">
    	<?php wp_head(); ?>
    </head>
    
    <body <?php body_class(); ?> <?php generate_do_microdata( 'body' ); ?>>
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php generate_do_microdata( 'article' ); ?>>
    	<div class="inside-article">
    		<?php
    		/**
    		 * generate_before_content hook.
    		 *
    		 * @since 0.1
    		 *
    		 * @hooked generate_featured_page_header_inside_single - 10
    		 */
    		do_action( 'generate_before_content' );
    
    		$itemprop = '';
    
    		if ( 'microdata' === generate_get_schema_type() ) {
    			$itemprop = ' itemprop="text"';
    		}
    		?>
    
    		<div class="entry-content"<?php echo $itemprop; // phpcs:ignore -- No escaping needed. ?>>
    			<?php
    			the_content();
    
    			wp_link_pages(
    				array(
    					'before' => '<div class="page-links">' . __( 'Pages:', 'generatepress' ),
    					'after'  => '</div>',
    				)
    			);
    			?>
    		</div>
    
    		<?php
    		/**
    		 * generate_after_content hook.
    		 *
    		 * @since 0.1
    		 */
    		do_action( 'generate_after_content' );
    		?>
    	</div>
    </article>
    
    <?php
    /**
     * generate_after_footer hook.
     *
     * @since 2.1
     */
    do_action( 'generate_after_footer' );
    
    wp_footer();
    ?>
    
    </body>
    </html>
    
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.