Finding Post and Category IDs in WordPress

To take full advantage of all the WordPress template tags and functions it is often required to use post IDs and category IDs. These values can be found conveniently in the WordPress admin area, without needing to refer to the database.

Finding a WordPress Post ID

To find the ID of a particular post or page in the admin area, you will first need to navigate to Posts > Edit or Pages > Edit as applicable. If you then roll over the link to edit the corresponding page or post, your browser’s status bar will display the url for editing that page. This url will include ‘post=’ and then the ID (e.g. in the image below the post ID is 218).

post-ids

Finding a WordPress Category ID

To find the ID of a category in the admin area, you can will first need to navigate to Posts > Categories. From the list of categories that will then be visible on the right, you can then roll over the Edit link for the category corresponding to the ID that you need. In your browser’s status bar the url for editing that category will then be visible. This url will include ‘cat_ID=’ and then the category ID (e.g. the category ID for the ‘Business’ category in the example below is 4).

category-ids

Finding a link category ID is a very similar process – the ids in this case are available via Link > Link Categories.



Related Posts

  • Adding PDF Links to WordPress Posts and Pages

    Linking to a pdf can, in many cases, be a very convenient way to add content to your site. We often find that clients will want to add menus, brochures, instructions etc. that may be most effectively viewed, shared or printed in pdf format. Uploading a pdf and adding a link in your site’s content [...]

  • add_theme_support() – a Function to Change the Future of WordPress Theme Development

    One relatively new function that could be making a big difference to the future of WordPress theme development is add_theme_support(). The function was introduced late last year with the release of WordPress 2.9. The major current use for add_theme_support() is for conveniently setting thumbnail images for posts and pages. When WordPress 3.0 is released (scheduled [...]

  • Using Short Codes to Easily Format WordPress Page Content

    Custom short codes can be extremely useful towards setting up a conveniently manageable WordPress theme design. Since WordPress 2.5, there has been in-built support for creating custom short codes using the add_shortcode() function. A Basic add_shortcode() Example In the example below I have used the short code [go] (square brackets are always included as part [...]

Find out more about Juno style Wordpress web design
Find out more about Juno style Magento web design
Find out more about Juno Blinds
Remote control and electric blinds by Controliss

Return to web design news.

Leave a Comment