Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Garconis/71dbbfd1ce83f14b4a8fa7ac588e2fad to your computer and use it in GitHub Desktop.
Save Garconis/71dbbfd1ce83f14b4a8fa7ac588e2fad to your computer and use it in GitHub Desktop.
WooCommerce | Change category page title on the frontend
<?php
/**
* Change "Featured" category name on the frontend
* if on the product page of Featured, then change the "Featured" text to be custom text instead
**/
function change_woocommerce_category_page_title( $page_title ) {
if ( ( is_product_category() ) && ( 'Featured' == $page_title ) ) {
$page_title = "Your Custom Category Title Here";
}
return $page_title;
}
add_filter( 'woocommerce_page_title', 'change_woocommerce_category_page_title', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment