Archived topic
Site title that changes according to each category
7 replies · Started by Jaime on October 23, 2017
Hello
Very satisfied with this theme
I ask for help for the following
I've tried to create a plugin so that the site title changes in each category.
But I can not find the filter of the title of the site or how to call it to change according to each category.
Could you tell me how to identify you or how you could achieve this?
Thanks in advance
Hi there,
Are you hoping to manually enter each title or there is some logic to it with respect to the category name?
Let me know.
Hi leo
Thank you for answering and apologizing my English
In my case it is best to enter each title manually
I really appreciate your colboration.
PDTA: If it is possible to do the same with the description of the site would also be very useful, but if not; with the title is enough.
Thanks
Is something like this what you are looking for?
https://generatepress.com/forums/topic/custom-page-titles-for-categories/#post-190895
Hi Leo, thanks again for responding
No, what I'm looking for is:
If I am in the home, then the site title is by default
If I am in "category1" then the site title is a custom title (which I enter manually in the function)
if I am in "category2" the site title is another personalized title differently (which I enter manually in the function)
It is not the title of the category that I want to change. It is the site title, depending on the category you are seeing.
Thanks in advance
Hi there,
You could use this WP filter: https://codex.wordpress.org/Plugin_API/Filter_Reference/option_(option_name)
For example:
add_filter( 'option_blogname', 'tu_custom_site_title' );
function tu_custom_site_title( $name ) {
if ( is_category( 'Whatever' ) ) {
return 'Custom title';
}
return $name;
}
Perfect
I worked perfectly, according to what I needed
Thanks Tom and Leo for the support, and patience, wonderful them and effective support.
Greetings and success
Glad we could help!