Home » Wordpress » WordPress get specific page or post ID

WordPress get specific page or post ID

How can I get specific page or post ID to any page/plugin/widget in the WordPress.You don’t have a write sql codes.Simply call to WordPress core functions only.If you want to get page or post ID to any page like plugin page, template page, inside functions, outside functions no matter you can use this.
My another post is described how to get specific page or post content.

Okay.We’ll see how to get specific page or post ID.

Get Current page or post ID

If you are inside a loop, then get Current page or post ID as follows.

If you are outside a loop, then get Current page or post ID as follows.(This is the another method to get current page ID).

Tags

Similar posts