• Carl V

    (@carlos-amigos)


    I have this code on my sidebar and instead of NOT outputting the code on a 404 page is outputs all children pages throughout my site…how can I stop this? — Is there another way of doing “NOT EQUAL TO 404, or this !is_404”

    if( is_page() && !is_404() && $post->post_parent)
    $children = wp_list_pages(“title_li=&sort_column=menu_order&child_of=”.$post->post_parent.”&echo=0″); else
    $children = wp_list_pages(“title_li=&sort_column=menu_order&child_of=”.$post->ID.”&echo=0″);

    Thanks
    Carl

Viewing 1 replies (of 1 total)
  • Your else statement is still being executed. You need something like this:

    if(!is_404()) {
    if(is_page() && $post->post_parent) {
    $children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->post_parent."&echo=0");
    } else {
    $children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->ID."&echo=0");
    }
    }

Viewing 1 replies (of 1 total)
  • The topic ‘how come this does not work “!_is_404”’ is closed to new replies.