Category Template Tags

The following functions can be used on the category.php template to display information about the current category.

Display Current Category Title on category.php:

<?php single_cat_title(); ?>

<?php single_term_title(); // more generic - can be used on archive.php too ?>

Display Current Category Description:

<?php echo category_description(); ?>

Get Current Category Object:

<?php $this_cat = get_queried_object(); ?>

Use Category Object returned above to get ACF fields on category:

<?php the_field( 'category_landing_page_hero_image', $this_cat ); ?>

Display Category Link – works for custom taxonomies and post categories.

<?php echo get_category_link( $category_id ); ?>
Do NOT follow this link or you will be banned from the site!