WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
[resolved] Code for Child of a page AND that page. (2 posts)

  1. laptophobo
    Member
    Posted 1 year ago #

    Hi,

    Within the code examples is:

    global $post; return (in_array(77,get_post_ancestors($post)));

    which is that WP page that is a child of page 77. But, I wish to also include that parent page (i.e.: page 77) with this group. Is that possible? Can someone show me?

    Thanks so much!

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

  2. laptophobo
    Member
    Posted 1 year ago #

    I found the solution. Sorry for the post.

    The "is" tag, e.g.: "is_page(77)" covers both the parent and children.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.