- This topic has 7 replies, 4 voices, and was last updated 2 years ago by
David.
-
AuthorPosts
-
August 1, 2017 at 11:38 am #358196
Kris
Hey Tom, I was looking at the theme and was wondering how to filter out *Category:* on archived category pages with a plugin.
This is what I’ve found so far.
add_filter( 'generate_archive_title', function ($title) { if ( is_category() ) { $title = single_cat_title( '', false ); } return $title; });
GP Premium 1.3.1August 2, 2017 at 12:30 am #358439Tom
Lead DeveloperLead DeveloperThat looks like it should work – is it not working for you?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 2, 2017 at 1:35 am #358464Kris
Not really! Any thoughts?
August 2, 2017 at 9:43 am #358635Tom
Lead DeveloperLead DeveloperActually, the word “Category” shouldn’t display in your title by default. Can you link me to the page?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentApril 9, 2019 at 3:08 am #863692Toni
I tried the Simple CSS code and the word “Category:” continues to appear in the title. Do you have another solution? I also tried to make a new hook – but can’t find where to make a new hook. Appearances/Elements in the instructions – but Elements is not there. My page is still on local. Can you help?
April 9, 2019 at 8:33 am #864157David
StaffCustomer SupportHi there,
any chance you can raise a new Topic where you can provide a link to your Site using the Site URL Field.
For the missing Elements, make sure you have the Elements module activated in Appearance > GeneratePress
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/April 10, 2019 at 12:49 am #864665Toni
Okay – I found the way to add a new hook. I do not know what to do now. The hook I want is to remove the word “Category:” from the archive title. So far I am on the page called Add New Element. What is the title? Would “Remove word category from title” work? I selected before_archive_title, and checked Execute Shortcodes. I do not know what to do about Execute PHP, and Priority. Also, I do not know the code to enter. And what about the Display Rules…For Location I put “All Archives”. Exclude is blank. Users is “All Users”. Can you please send a link with these instructions?
April 10, 2019 at 6:13 am #864892David
StaffCustomer SupportSorry the two things are unrelated. The “Category” should not display by default, its not something that can be removed by using Hooks. I need to be able to see the Site so we can try and ascertain where it is coming from.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.