Forums

how to retrieve category nicename? (2 posts)

  1. antonskey
    Member
    Posted 5 years ago #

    i require pulling the category's nicename (slug) to utilize the RumCategory plugin in conjunction with the RumMovie plugin. Unfortunately I can't see how I would do this as I can't find anywhere that explicitly tells me how to retrieve the nicename for use in a template.

    Any help would be greatly appreciated.

  2. Kafkaesqui
    Moderator
    Posted 5 years ago #

    If this is for category queries (and not say categories of a post), you can collect it through:

    $category = $wp_query->get_queried_object();

    The category's nicename is then available through:

    $category->category_nicename

Topic Closed

This topic has been closed to new replies.

About this Topic