No matter how many or what type of snippet code you use on your WordPress theme’s functions.php file, once in a while you will see it’s necessary to find the ID number. Whether you are talking about post, page, tags, categories or even media files. All of these elements has their very specific ID number. If you are not very familiar with WordPress, this post will help you to give some idea on how easily you can find the IDs of these elements.
The procedure is very simple and a easy to understand. So, I hope it won’t take whole lots of time for you to grab my ideas. Here is how it works.
Find Tags & Categories ID Number
First of all, log in to your WordPress site and click on “Posts”. From the sub menu item click on either “Tags” or “Categories” depending on what exactly you are looking for. A new window will appear on the right hand side of the screen and you will find whole lots of “tags” or “category” items. Click on the desired “tag” or “category” item and look at the URL. You will find something like “tag_ID=xxx”. This “xxx” stands for the number of the ID. It could be the ID for tags or category items.
Find Post & Page ID Number
Just like before click on the “Posts” and then from the sub menu click “All Posts”. Here you will find all the posts that you have written so far. To find any specific post ID number, first locate the post and click on the “title” of the post, as if you are going to edit the post. Like before, look at the URL and locate “post=xxx”. As I said before “xxx” always stands for number. The same rule applies for “Pages” as well. Go the “Pages” and from there click on the title of the page. You will find the number from the URL just like posts. Interesting enough that the post or page always represents as “post”. Funny right?
Find Media ID
We all use images or videos on our posts. So, if for some reason you need to find the ID number of any specific image of video, go to the “Media”. You will see all the images and other media elements on your library. Click on the title or the element itself and look at the URL. Find “attachment_id=xxx”. I hope you got your ID number.
Find User ID
If you have a multi-author/user based web or blog site, chances are there that you would have many profiles. You can locate their ID from “Users” menu. Click on any author or user’s profile and the URL will show something like “user_id=xx”, that’s the user ID. Now, keep it in mind that the “Admin” account’s ID always should be “1” in general case. Of course as the admin of your site, you can appoint another person as the admin but that doesn’t make whole lots of a difference. Original Admin ID is always 1.
This is pretty much it on this topic. I hope this post will help you to easily locate the various ID numbers which you may need time to time, especially if you are using custom snippet codes on your theme. I will update this post as soon as I find relevant information.