Last active
November 30, 2015 04:15
-
-
Save mandiwise/6f16188c1a4fabe826e5 to your computer and use it in GitHub Desktop.
Customize archive title in WP
This file contains 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 | |
/** | |
* Customize the Product archive title | |
*/ | |
function red_archive_title( $title ) { | |
if ( is_post_type_archive( 'product' ) ) { | |
$title = 'Our Products Are Made Fresh Daily'; | |
} elseif ( is_tax( 'product-type' ) ) { | |
$title = sprintf( '%1$s', single_term_title( '', false ) ); | |
} elseif ( is_post_type_archive( 'testimonial' ) ) { | |
$title = 'Testimonials'; | |
} | |
return $title; | |
} | |
add_filter( 'get_the_archive_title', 'red_archive_title' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment