• I’m not sure if I am just not seeing the obvious, but can anyone tell me how you can reveal the category ID’s for BOTH post categories and link categories?

    I have several conditional statements for sidebars that rely heavily on checks for specific ID numbers for various link and post categories.

    Is there no easy way to see the ID’s of these categories beyond looking them up inside the mySQL tables?

    Incidentally, it is very important to know the category ID for some of WordPress’ own calls. For example:

    wp_list_bookmarks

    List Bookmarks has a category call that allows the integer/category number to be displayed, as do a lot of other functions allow the use of specific ID numbers as qualifiers.

    I must be blind… surely to find the ID’s, one must not need to use phpMYadmin or webmin or other mySQL tool just to see what they are.

Viewing 3 replies - 1 through 3 (of 3 total)
  • chris

    (@christhomson)

    You can find out the category IDs by going to yoursite.com/wp-admin/categories.php and clicking on the category, then looking in the URL, and you will see cat_ID=# … that number is the category ID.

    To find out Link category IDs, simply go to yoursite.com/wp-admin/link-manager.php and clicking on the category beside one of the links. Again, you’ll see &cat_id=# in your address bar.

    Thread Starter Rongo

    (@rongo)

    Chris, I saw that already, thanks.

    Really, I would guess that this is an oversight on the part of the developers. Or certainly I hope it is, as otherwise it’s pretty ridiculous to expect people to follow directions in the codex, with regards to category ID operations, by having them obtain those ID’s with a mouseover and reading their browser’s status bar.

    Category ID’s are used in a variety of functions, not to mention they play a key role in custom category pages (category-##.php) where ## = the category ID.

    If that’s not an oversight, then it’s a line of thinking I’ll not figure out anytime soon, and it essentially makes the entire codex documentation / examples out of date for any reference to category ID’s.

    joannes

    (@joannes)

    Rongo you’re right – it’s really annoying. I cannot imagine what the logic of removing them was when so many functions rely on you knowing what they are. The good news is someone produced a plugin already to solve it! Have a look at this post

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Revealing Category ID Numbers’ is closed to new replies.