[Resolved] How to get the current page id
I want to use current page id in PHP to do a conditional branch in the template, but when I use $id. $post->ID, or the_ID(), I got the wrong ID.
For example, the target page I want to make a difference is ID 7, but when I use the_ID() I got 1306 returned, which is the newest blog post that I just made.
- The topic ‘[Resolved] How to get the current page id’ is closed to new replies.