WordPress.org

Ready to get started?Download WordPress

Forums

Documentation suggestion (2 posts)

  1. WWDay3
    Member
    Posted 4 years ago #

    Better cross referencing of functions.

    I needed to do this: Always get the name for a specific category ID. Period. I didn't need to get the category name related to a post or anything like that. I didn't need to query categories to find a specific one. I experimented with using the various functions referenced from get_the_catgegory (single_cat_name, etc.), but I couldn't seem to find a simple functions for "give me the name of category 1".

    I tried all kinds of searches for "get category name", but the results all seemed to lead back to get_the_category or one of its variations. In desperation, I "guessed" at "get_cat_name" and typed it in Google. Sure enough, there it was - but it was listed nowhere near all of the other category functions - it didn't reference them, and they didn't reference it.

    I could have saved a ton of time if "get_cat_name" had been cross referenced at the "get_the_category" page.

  2. MichaelH
    Member
    Posted 4 years ago #

    And there is:

    $catid = get_cat_ID('events');

    Also, just in case you need ID numbers for other 'things':
    How do I determine a Post, Page, Category, Tag, Link, Link Category, or User ID?

Topic Closed

This topic has been closed to new replies.

About this Topic