Created
April 27, 2018 20:51
-
-
Save Garconis/71dbbfd1ce83f14b4a8fa7ac588e2fad to your computer and use it in GitHub Desktop.
WooCommerce | Change category page title on the frontend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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