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?
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?
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
This topic has been closed to new replies.