[Resolved] Adding Taxonomies to generate_archive_title() function?

Home Forums Support [Resolved] Adding Taxonomies to generate_archive_title() function?

Home Forums Support Adding Taxonomies to generate_archive_title() function?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #278916
    Dave

    Hi All,

    I have a taxonomy (offering_category) which will have a variable number of terms within it. I found the generate_archive_title() function in template-tags.php, but see only instances in which both the taxonomy and term are specified, like so:

    elseif ( is_tax( 'post_format', 'post-format-link' ) ) :
    					_e( 'Links', 'generatepress' );

    Since the categories are variable and I’d rather not create an elseif for each category, I think I need something like this:

    elseif ( is_tax( 'offering_category' ) ) :
    					_e( $category_name, 'generatepress' );

    But I’m not sure how to get $category_name (where $category_name is equal to the category being viewed). Hoping someone can give me some guidance. πŸ™‚

    Thanks,
    Dave

    #278942
    Tom
    Lead Developer
    Lead Developer

    Not 100% sure, but this might help: https://codex.wordpress.org/Function_Reference/get_queried_object

    Let me know πŸ™‚

    #279975
    Dave

    Thanks! I was able to get it working using the reference you mentioned and the following StackOverflow article:
    http://wordpress.stackexchange.com/questions/84267/listing-category

    #280011
    Tom
    Lead Developer
    Lead Developer

    Awesome πŸ™‚

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.