• Resolved lee718

    (@lee718)


    I am trying to exclude the children of the Home page from outputting some code. The page id of Home is 5. Do I have something missing?

    if ( !is_home() && !(is_page(5) || ($post->post_parent=="5")) && !is_front_page() && !is_attachment() || is_paged() )

Viewing 1 replies (of 1 total)
  • Thread Starter lee718

    (@lee718)

    I found the answer to my problem was that I had the following which I removed.
    $parent_id = $post->post_parent;

Viewing 1 replies (of 1 total)
  • The topic ‘exclude page and children uisng $post->post_parent in conditional’ is closed to new replies.