WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] exclude page and children uisng $post->post_parent in conditional (2 posts)

  1. lee718
    Member
    Posted 1 year ago #

    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() )

  2. lee718
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic