I have an extra submenu with this code in the sidebar:
if(is_404() || is_search()) :
echo 'should be empty';
else :
if($post->post_parent == '68')
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
else
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
if ($children) {
?><ul><?php echo $children; ?></ul><?php
}
endif;
I have a problem with the first line. It’s working fine on the 404 page and on the search page if you search for something that doesn’t exist, but when you look for something that does exist, the submenu is popping up in the sidebar. What is wrong with this code?