Forums

Condition statements for Widget Logic (2 posts)

  1. timhaughton
    Member
    Posted 2 years ago #

    Hi, I'm using Widget Logic to manage conditional appearance of Widgets in the sidebar.

    I have a page structure:

    http://www.domain.com/products/prod1/
    http://www.domain.com/products/prod1/screenshots
    http://www.domain.com/products/prod1/tour
    http://www.domain.com/products/prod1/foo

    prod1's ID is 602. I want the widget to appear on page 602 and all URLs descendant from page 602. Here's what I've tried:

    global $post; return (is_page(602) || $post->post_parent=="602");

    and

    global $post; return (is_page(602) || in_array(602,get_post_ancestors($post)));

    Neither of these seem to evaluate correctly. The widget is shown on page ID 602, but not on children. What am I doing wrong?

  2. timhaughton
    Member
    Posted 2 years ago #

    Bump

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.