Tagged: Tags
Hi there, I just noticed my tag search pages are missing a title to show what tag is being shown
http://www.theburningear.com/tag/los-angeles/
You can see it says “Posts” at the top, but not “Los Angeles posts” as it should to be clear. How can I add/edit this headline for tag pages? I’d like to make it big bold and clear that tag pages are for posts with that tag.
Thank you!
Brandon
Hey!
Try adding this at the very end of your theme / child theme functions.php file:
function enfold_tag_title_func() {
$queried_object = get_queried_object();
return $queried_object->name;
}
add_filter('avf_tag_label_names', 'enfold_tag_title_func');
Cheers!
Josue
Thanks Josue, that worked and now it says the tag name instead of just “Post”. But how can I add the text “Posts about” so that is says “Posts About [TAG NAME]”? And is it possible to edit the size and formatting? CSS?
Thanks!
Change the code to:
function enfold_tag_title_func() {
$queried_object = get_queried_object();
return "Posts about: ".$queried_object->name;
}
add_filter('avf_tag_label_names', 'enfold_tag_title_func');
Unfortunately that creates an error
“Catchable fatal error: Object of class WP_Term could not be converted to string in /nfs/c07/h04/mnt/178875/domains/theburningear.com/html/wp-content/themes/enfold/functions.php on line 524”
http://www.theburningear.com/tag/los-angeles/
My bad, check my updated message.
Great, thank you!
You are welcome, glad to help :)
Regards,
Josue