• vasilescu_anton

    (@vasilescu_anton)


    Hi everybody,

    I’ve been struggling for couple hours now to get the post id of a static page on which i’ve added the loop to display some posts in a certain category. I know that the page id for the static page is 18 while the id of the first post displayed on the page is 165.

    Now, when I use the_ID() I get 165 or if I try is_page(’18’) it returns false! Why is it returning the id of the first post instead of the parent page?

    Any idea what am I doing wrong here?

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

    (@vasilescu_anton)

    Ok, so to make this even more clear, I have the_ID() and is_page() in the sidebar.php and I need it evaluated in the main page that calls it. Does this make a difference? Also the sidebar.php has it’s own loop that builds a list of the 3 posts that are displayed on the main page.

Viewing 1 replies (of 1 total)
  • The topic ‘how to get the proper post id on a static page with a post on it’ is closed to new replies.