woocommerce_template_loop_category_title( object $category )

Show the subcategory title in the product loop.


Description Description


Parameters Parameters

$category

(Required) Category object.


Top ↑

Source Source

File: includes/wc-template-functions.php

	function woocommerce_template_loop_category_title( $category ) {
		?>
		<h2 class="woocommerce-loop-category__title">
			<?php
			echo esc_html( $category->name );

			if ( $category->count > 0 ) {
				echo apply_filters( 'woocommerce_subcategory_count_html', ' <mark class="count">(' . esc_html( $category->count ) . ')</mark>', $category ); // WPCS: XSS ok.
			}
			?>
		</h2>
		<?php
	}

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.