WordPress.org

Ready to get started?Download WordPress

Forums

Revealing Category ID Numbers (4 posts)

  1. Rongo
    Member
    Posted 6 years ago #

    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.

  2. ChrisThomson
    Member
    Posted 6 years ago #

    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.

  3. Rongo
    Member
    Posted 6 years ago #

    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.

  4. Joannes
    Member
    Posted 6 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic