Widget Logic
Quick question! Need to hide instead of add widgets! (2 posts)

  1. welshhuw q1
    Posted 5 years ago #

    What is the opposite of this code?

    global $post; return (is_page('home') || ($post->post_parent=="13"));

    I want to hide a widget from all subpages of a parent page, but make sure to appear on the rest of the site.



  2. allanriddle
    Posted 5 years ago #

    I think what you are looking for is the ! (not).

    I don't have a lot of experience working with this plugin but from what I read on other forums, to achieve this kind of functionality you would simply use:


    This should make the widget show on all pages except the home page. You can link conditionals together like:

    !is_page('home') AND !is_page('contact')

    to exclude the widget from those two pages and still show on the rest of the site. so the !=NOT and reverses the conditional.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic