Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function change_title_based_on_category( $title, $post_id = null ) {
- if ( in_category('some_category', $post_id ) ) {
- return 'My changed title';
- }
- return $title;
- }
- add_filter( 'the_title', 'change_title_based_on_category', 10, 2 );
Add Comment
Please, Sign In to add comment