• feliciepr7

    (@feliciepr7)


    Hi there,
    I want to remove the header for the rest of my pages and only have it at the home page. I am able to remove it just from One Page Only but dont know how to do the same with the rest. This is what I did:

    Code:

    <?php if( !is_page( ‘en-vivo’ ) ) : ?>

    <?php $customheader_on = get_option(‘dev_studio_customheader_on’);

    if ($customheader_on == “yes”){

    ?>

    <?php locate_template( array( ‘/library/components/customheader.php’ ), true ); ?>

    <?php endif; ?>

    I am using this <?php if( !is_page( ‘en-vivo’ ) ) : ?> to remove the header for the page en-vivo. Now how can I add the other pages?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Dandy Plow

    (@dandy-plow)

    You can add other pages to the list with a simple &&:

    <?php if( (!is_page( 'en-vivo' )) && (!is_page( 'some-other' )) && (!is_page( 'this-page' )) && (!is_page( 'your-page' )) ) : ?>

    dagal

    (@dagal)

    I was wondering if there’s a code to write in the custom CSS instead of tweaking the code in editor itself. I have tried different things I found on the forum but nothing worked so far (most of those things were apparently outdated :s ). I’ve contacted the support but haven’t received any reply yet.
    My theme is radiate.
    Thank you.

    elisabetha

    (@elisabetha)

    You can make a copy of the php you work with and place it in the themes folder. Or better make a child of the thems folder so it won’t be overwritten with an update of the theme.
    Then in the copy you change the title:
    <?php
    /*
    Template Name: new name
    */

    In this copy you remove the oce that creates the header. This depends on the theme you use. It might be something like

    <div id=”gazpo-nav”>
    <?php wp_nav_menu( array( ‘container_class’ => ‘main-menu’, ‘theme_location’ => ‘header_menu’ ) ); ?>
    </div>

    And you base the pages that don’t need the header on this template.

    Thread Starter feliciepr7

    (@feliciepr7)

    @dandy Plow: I try the code you post and it didn’t work for me. This is what I put:
    <?php if( !is_page( ‘en-vivo’ ) ) && (!is_page( ‘videos’ )) && (!is_page( ‘online-giving’ )) && (!is_page( ‘contacto’ )) && (!is_page( ‘peticiones’ )) && (!is_page( ‘guessbook’ )) ) : ?>

    Is that right?

    elisabetha

    (@elisabetha)

    You should not add the code I wrote down. You must remove the code that creates the header. For your theme that might look different then for my theme. NOTE: only in the template that you use for a page without a header and not for the template for a page with a header!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to Remove Header for multiple pages?’ is closed to new replies.