Tagged: 

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #606264

    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

    #606351

    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

    #606365

    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!

    #606366

    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');
    • This reply was modified 4 years, 7 months ago by  Josue.
    #606374

    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/

    #606377

    My bad, check my updated message.

    #606381

    Great, thank you!

    #606384

    You are welcome, glad to help :)

    Regards,
    Josue

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.