How to remove a banner add from one page (6 posts)

  1. hfhealy
    Posted 2 years ago #

    I'm wondering if there's a way to remove the top banner from one page of my website. I want to keep the banner on every other page, except one.

    My website is- http://www.healyrealfoodvegetarian.com

    The page I want to remove the banner is- http://www.healyrealfoodvegetarian.com/gluten-free-vegetarian/

  2. Evan Herman
    Posted 2 years ago #

    You will need to write conditional statements to decide what page the user is on, and if the banner should display or not.

    You will need to get the current page you are on, I usually do this by title.

    You will also need to assign a class or id to your 'img' which is the banner...

    this is just an example:

    $pageTitle = get_the_title();
      if ($pageTitle == 'gluten-free-vegetarian') { ?>
    <style>#banner { display:none; }</style>
    <?php } ?>

    hope this is of some help to you.

  3. WPyogi
    Forum Moderator
    Posted 2 years ago #

    You can also do what you are asking about using the page-specific class in CSS - but you've created some significant mark-up errors in your header.php file, so I'd suggest you fix those first.


    Not all of those are problematic, but you should never add any code above the DOCTYPE on any webpage.

    You also should not be modifying any theme files without using a Child Theme - as your changes will be lost when the theme is updated - http://codex.wordpress.org/Child_Themes

    If you want help with the CSS to use after doing the above, post back.

  4. hfhealy
    Posted 2 years ago #

    I just installed a child theme, but I really don't know what I'm doing and it messed up the design of my whole sight. Can you tell me how to remove the child theme and put it back to how it was before?

  5. WPyogi
    Forum Moderator
    Posted 2 years ago #

    You can just activate the parent theme again. But theme settings/options don't carry over to a child theme - so that may be why it looks different - you have to redo those. Still, better than losing all your changes when the theme is updated or not being able to update.

  6. hfhealy
    Posted 2 years ago #

    Thanks WPyogi. I'm in over my head here..I don't know anything about coding, so I'm not surprised there are so many errors. I'm not sure how to fix those.

Topic Closed

This topic has been closed to new replies.

About this Topic