WordPress get specific page or post ID

0

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

Share.

About Author

Sumith Harshan is the Web Engineer Specializes in Java Script, JQuery, HTML4/5, CSS2/3, PHP, CodeIgniter, CakePHP, J2SE, J2EE, XML, Hacking & Security, Mobile Interface Developing, Magento, Wordpress, Joomla, Drupal,PHPBB,Facebook App Developing and Open cart...etc.