-
AuthorPosts
-
July 25, 2016 at 8:55 pm #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!
July 25, 2016 at 10:57 pm #664899Hey!
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!
JosueJuly 25, 2016 at 11:05 pm #664912Hey 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?
July 25, 2016 at 11:23 pm #664930Hi,
Can you please create us a WordPress administrator account? post it here as a private reply.
Regards,
JosueJuly 25, 2016 at 11:30 pm #664936Sure, see below, and thanks!
July 25, 2016 at 11:56 pm #664951Hi,
Login provided doesn’t seem to work, please re-check.
Best regards,
JosueJuly 25, 2016 at 11:56 pm #664952Hi,
Best regards,
JosueJuly 25, 2016 at 11:57 pm #664954Please try again :)
July 28, 2016 at 2:57 am #666016Hi,
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,
IsmaelJuly 28, 2016 at 8:43 pm #666407Hey 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!
July 30, 2016 at 5:19 am #666774Hi,
check it now.
Best regards,
JosueAugust 2, 2016 at 8:22 pm #667810Hi 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!
August 3, 2016 at 4:25 pm #668138Hi,
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,
YigitAugust 3, 2016 at 4:30 pm #668144Hi Yigit,
Perfect!!!
Thanks so much!
-
AuthorPosts
- The topic ‘How to change header text on Tag page to reflect tag selected?’ is closed to new replies.
