WordPress.org

Support

Support » Plugins and Hacks » Page of Parent Page

Page of Parent Page

  • bplumb
    Member

    @bplumb

    Hi,

    I am trying to get a widget to show when it is page XYZ or a child of XYZ (page 4).

    I have used:

    is_page(‘XYZ’) || ($post->post_parent==”4″)

    If I am on mysite.com/XYZ then it works fine, but as soon as I am on mysite.com/XYZ/ABC it no longer shows (even though XYZ is page 4 and set to be a parent of page ABC).

    Any ideas?

    http://wordpress.org/plugins/widget-logic/

Viewing 2 replies - 1 through 2 (of 2 total)
  • thomasjojo
    Member

    @thomasjojo

    Did you find out of this? I need that too. BUt as you say, it does not work.

    bplumb
    Member

    @bplumb

    Yep, sorted. You need to ensure your code is exactly as laid out in the Other Notes pages…

    global $post; return (is_page(‘XYZ’) || ($post->post_parent==”4″));

    This will work perfectly!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Page of Parent Page’ is closed to new replies.