Thread Starter
scooby
(@scooby)
Well I don’t think that will get what I’m trying to do here.. Im trying to get the main menu to highlight when going into the comments on a post.. Say I have a page named blog that shows all posts.. That page is now the current_page_item and works great.. The problem Im trying to solve is when you click to view the comments on a particular post.. The main blog link is no longer the current_page_item and I would like it to be.. Is there a possibilitly to get this to work.. I’m pretty stuck now..
Thread Starter
scooby
(@scooby)
Would anybody know how to do the following?? I’m trying to get the actual page id and not the post id..
This is what works for the post id:
echo $post->ID;
I’m trying to get something like this to work:
echo $page->ID;
Any ideas out there??
Actually I believe it is just $post->ID, if you dig into the docs you’ll discover that the post table is used to store posts, pages, and attachments.
And you can also use the template tag the_ID() instead.
See the docs: http://codex.wordpress.org/Template_Tags
You might also find these conditional tags helpful:
http://codex.wordpress.org/Conditional_Tags