- This topic has 3 replies, 2 voices, and was last updated 5 years, 1 month ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forums › Pro Themes › Tourable Pro › Remove the word Category from Category: Category Title on archive pages
Tagged: archive pages, customizations
Hello, I would like to change or remove “Category:” here to just be the Category Title. Alternatively, it would be ok to have it reflect the custom category base updated via permalink structures. In this case it would be the word “Show”. Please advise at your earliest convenience. Thanks!
Hello @hchtis,
Thank you for using the theme.
To remove the category you need to go through the child theme.
After activating the child theme in your child theme functions.php file add below given code:
function tourable_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>' ;
} elseif ( is_archive() ) {
$title = preg_replace('/^\w+: /', '', $title);
}
return $title;
}
add_filter( 'get_the_archive_title', 'tourable_pro_child_custom_cat_title_removal);
Hope this helps.
Thank you
Will this just remove the word “Category” or the whole “Category : Category Title” line. I just want to remove the “Category:” proceeding the category title. Is there a way to do this without activating and reconfiguring a child-theme?
Hello,
The code we have provided above will remove the word “Category” not the whole “Category : Category Title” line. So, for this please add above given code in functions.php file of your child theme.
If you have any queries further, let us know.
Thank you.
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |