WordPress.org

Support

Support » How-To and Troubleshooting » parent_id always zero

parent_id always zero

  • I’m trying to use the parent_id to control my sidebars but when I display ther post->parent_id it is always zero. Any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Michael

    @alchymyth

    Forum Moderator

    do you mean:

    $post->post_parent

    it might also be disturbed by the loop/query in the main content;

    to reset this, you could try to add: wp_reset_query(); before your conditional statement.

    So simple. Yes that’s what was needed. Cheers

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