The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

parent_id always zero (3 posts)

  1. StevieG
    Posted 5 years ago #

    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?

  2. Michael
    Forum Moderator
    Posted 5 years ago #

    do you mean:


    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.

  3. StevieG
    Posted 5 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic