Site logo

Archived topic

Adding Taxonomies to generate_archive_title() function?

3 replies · Started by Dave on February 14, 2017

Viewing posts 1–4 of 4

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

Awesome :)

This archived topic is closed to new replies.