Widget Logic
Would like to hide widget on specific pages (4 posts)

  1. lcaum
    Posted 5 years ago #

    Hello, I'm using this plugin to develop a small e-commerce website.

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

    The code above shows "product categories" on the home page, the store page, and children posts of the store page.

    However, for increasing conversion rates, I'd like to hide the "product categories" on Cart page which is a child of the Store page.

    Please advise! Thanks in advance.

  2. Jan.lipavsky@gmail.com
    Posted 4 years ago #

    correct syntax is "!is_page(array(XX, YY, ZZ))"

    it works for me

  3. mhaus-org
    Posted 4 years ago #

    Hi, Newbie here.
    Would like to prevent a widget from appearing on a specific page. I looked at the code below but could not figure it out. Might you have a suggestion?

    A PAGE Page
    This section refers to WordPress Pages, not any generic webpage from your blog, or in other words to the built in post_type 'page'.

    When any Page is being displayed.
    is_page( 42 )
    When Page 42 (ID) is being displayed.
    is_page( 'About Me And Joe' )
    When the Page with a post_title of "About Me And Joe" is being displayed.
    is_page( 'about-me' )
    When the Page with a post_name (slug) of "about-me" is being displayed.
    is_page( array( 42, 'about-me', 'About Me And Joe' ) )
    Returns true when the Pages displayed is either post ID = 42, or post_name is "about-me", or post_title is "About Me And Joe".
    is_page( array( 42, 54, 6 ) )
    Returns true when the Pages displayed is either post ID = 42, or post ID = 54, or post ID = 6.

  4. alanft
    Plugin Author

    Posted 4 years ago #

    what specific page would you like to prevent the widget appearing on?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic