WordPress.org

Ready to get started?Download WordPress

Forums

Widget Logic
[resolved] How to display only in a pages under a parent's page? (2 posts)

  1. JustBlog
    Member
    Posted 2 years ago #

    Hi,

    Can someone please let me know how can I display something only in pages under a parent's page?

    For example: I have 1,2,3,4,5 pages under parent's page - A

    I would like to display something on all pages under parent's page A and not parent's page B. How should i do that? What codex function for this?

    Thanks!

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

  2. JustBlog
    Member
    Posted 2 years ago #

    Ok. I think i got the solution stated:

    global $post; return (in_array(77,get_post_ancestors($post))); -- WP page that is a child of page 77

    I just have to find what id of my parent's page is then replace it with the no. 77.

    Thanks! :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic