Home › Forums › Pro Themes › Graduate Pro › Changing H2 Taxonomy Heading
Tagged: categories, h2, Page title, tags, taxonomy
- This topic has 4 replies, 2 voices, and was last updated 6 years, 3 months ago by wensolutions.
-
AuthorPosts
-
September 6, 2018 at 3:25 pm #79123Dan SurdykaParticipant
Environment: Desktop, Windows 7, Firefox 61.0.2
URL: /site-title/category/category-title/1. Navigate to your posts page.
2. Select a category. The selected category list appears.Notice the h2 tag below the main navigation reading “category: category-title”. Is their anyway I can customize this text? I would ideally want to be able to edit “category:”, but removal of “category:” would also resolve my issue. (see screenshot http://nimb.ws/xvhGSo)
I would also like to be able to apply the same customization to the tags list page.
I noticed within the custom-header.php file on line 94
<h2 class=”page-title”><?php graduate_title_as_per_template();?></h2>
This seems to control this text. However, I cannot figure out how to edit the text in the code or backend. If someone can point me in the right direction it would be greatly appreciated.
Thank you
September 6, 2018 at 4:25 pm #79129Dan SurdykaParticipantSeptember 8, 2018 at 11:35 am #79261wensolutionsKeymasterHello @dsurdyka,
First of all thank you very much for using the theme.
Now to replace the text in the header as per your requirement in the category page you have to go through the child theme.
To know how to create and activate the child theme please go through the link given below:
http://wptravel.io/how-to-create-a-child-theme/
After activating the child theme in your child theme functions.php file please add below given code.
function graduate_pro_child_custom_cat_title_removal ($title) { if ( is_category() ) { $title = single_cat_title( '', false ); } elseif ( is_tag() ) { $title = single_tag_title( '', false ); } elseif ( is_author() ) { $title = '<span class="vcard">' . get_the_author() . '</span>' ; } return "Your desired text"; } add_filter( 'get_the_archive_title', 'graduate_pro_child_custom_cat_title_removal');
Hope this helps.
Regards!!
September 10, 2018 at 10:50 am #79358Dan SurdykaParticipantYes, this is very helpful.
Thank you!
September 10, 2018 at 12:03 pm #79362wensolutionsKeymasterHello @dsurdyka,
Glad we could help you.
If you have any issues further then please let us know.
Thank you.
Regards!!
-
AuthorPosts
- You must be logged in to reply to this topic.