Support » Fixing WordPress » How to remove a banner add from one page

Viewing 5 replies - 1 through 5 (of 5 total)
  • 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.

    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 –

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

    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?

    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.

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to remove a banner add from one page’ is closed to new replies.