- This topic has 3 replies, 2 voices, and was last updated 7 years, 8 months ago by Andrew Misplon.
Tagged: category; title
- AuthorPosts
- March 6, 2017 at 6:15 pm #6011
RutgerParticipantHi there,
Just on the brink of launching my website, but I do have one more question. I haven’t been able to find the answer on general WordPress discussions online – and hoped perhaps you are able to help out.
I use multiple categories of messages and use a category page to display all my messages of the ‘news’ variety: see: http://demodernetijd.nl/nieuws/. This works fine, but I would like my page to say “News” rather than “Category: News” in the page title. Is there a way to remove the text “Category: ” (my page is in Dutch, so actually ‘Categorie: “)?
Best wishes,
Rutger
March 6, 2017 at 11:22 pm #6013
Andrew MisplonKeymasterHi Rutger
Thanks for posting. Sure, we can edit the prefix, please, try the following:
1.
Plugins > Add New
, search for and install: Code Snippets.
2. Go toSnippets > Add New
, name the snippet as required and insert into the body:function ultra_archive_title( $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 $title; } add_filter( 'get_the_archive_title', 'ultra_archive_title' );
Scroll to the bottom of the page and enable the option labelled:
Only run on site front-end
. Finally, click Save changes and activate.Hope that helps.
March 7, 2017 at 12:08 am #6014
RutgerParticipantDear Andrew,
This is marvellous, couldn’t possibly have come up with this myself. Many thanks!!
Best wishes,
Rutger
March 7, 2017 at 12:10 am #6015
Andrew MisplonKeymasterSuper 🙂 Glad to hear that did the trick. Chat soon. Cheers.
- AuthorPosts
You must be logged in to reply to this topic.