Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #664817

    Hello!

    How can I change the Tag page header text to show the actual tag selected? I have tags set up for posts by individual authors, but when someone clicks to view Posts by Jim, the header on the Tag page says just “Posts”– it shows just the posts by Jim, but the header doesn’t say that. I would like it to say “Posts by Jim” if that is the tag they select.

    Links are below. Hope there is a way to do this using the child theme functions file and/or Quick CSS.

    Thanks in advance for your help!

    #664899

    Hey!

    Try adding this at the very end of your theme / child theme functions.php file:

    add_filter('avf_title_args', 'change_title_for_tag', 10, 1);
    function change_title_for_tag($args) {
    	if(is_tag()) $args['title'] = get_queried_object()->name;
    	return $args;
    }

    Cheers!
    Josue

    #664912

    Hey Josue,

    Thanks so much for the info, but it doesn’t seem to have changed the title displaying.

    Any idea what might be incorrect or missing?

    #664930

    Hi,

    Can you please create us a WordPress administrator account? post it here as a private reply.

    Regards,
    Josue

    #664936

    Sure, see below, and thanks!

    #664951

    Hi,

    Login provided doesn’t seem to work, please re-check.

    Best regards,
    Josue

    #664952

    Hi,

    Best regards,
    Josue

    #664954

    Please try again :)

    #666016

    Hi,

    Please replace the code with this:

    add_filter('avf_tag_label_names', 'avf_tag_label_names_mod', 10, 2);
    function avf_tag_label_names_mod($label)
    {
    	$label = single_tag_title('Posts by ', false);
    	return $label;
    }
    

    Best regards,
    Ismael

    #666407

    Hey Ismael,

    This gets it most of the way there, but “posts by” appears twice, so it says Posts by Posts by Randy. How to eliminate that duplication?

    Also, the font size on this is ginormous, how do I make it smaller?

    Thanks so much!

    #666774

    Hi,

    check it now.

    Best regards,
    Josue

    #667810

    Hi Josue,

    Problem fixed. :)

    Last thing– Is there an easy way to make the size of that header smaller? It looks huge compared to the rest of the site.

    Thanks!

    #668138

    Hi,

    Please try adding this code to the Quick CSS section under Enfold > General Styling or to your child themes style.css file:

    #top .fullsize .template-blog .tag-page-post-type-title {
        font-size: 20px;
    }
    

    Best regards,
    Yigit

    #668144

    Hi Yigit,

    Perfect!!!

    Thanks so much!

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘How to change header text on Tag page to reflect tag selected?’ is closed to new replies.