[Resolved] Site title that changes according to each category

Home Forums Support [Resolved] Site title that changes according to each category

Home Forums Support Site title that changes according to each category

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #408292
    Jaime

    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

    #408524
    Leo
    Staff
    Customer Support

    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.

    #408652
    Jaime

    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

    #408739
    Leo
    Staff
    Customer Support
    #409584
    Jaime

    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

    #409623
    Tom
    Lead Developer
    Lead Developer

    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;
    }
    #410323
    Jaime

    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

    #410409
    Leo
    Staff
    Customer Support

    Glad we could help!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.