skip to Main Content

how can i disable header for this specific page. Is there any php function that disables the header for a specific page? In wordpress

Here is the link: https://techmax.ro/elementor-14408/

2

Answers


  1. You can hide by CSS and using WP is_page function. check the below code.

    function hide_header_on_some_pages(){
        if( is_page( 'yourpagename' ) ){
            ?>
            <style type="text/css">
                .site-header {
                    display: none;
                }
            </style>
            <?php
        }
    }
    add_action( 'wp_head', 'hide_header_on_some_pages', 10, 1 );
    
    Login or Signup to reply.
  2. Put this condition where the code is done to get the menu.

    if(! is_page( ‘your-page-slug’ ) ){
          wp_nav_menu( array( ‘theme_location’ => ‘your menu name’, ‘container_class’ => ‘my_extra_menu_class’ ) );
    }

    Using this there is no extra dom element on this page.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search