[Resolved] Change Nav Logo For Different Category Pages

Home Forums Support Change Nav Logo For Different Category Pages

This topic contains 25 replies, has 3 voices, and was last updated by  Tom 1 year, 1 month ago.

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • #393327

    Tom Lead Developer
    #423991

    Bobby

    Hello Tom,

    I ran into a problem since updating to your newest update.

    After updating to GPP 1.4.3, everything was working just fine….the logo changed for the specific category and the main logo remained the same on the homepage. Well, yesterday, after updating to Version 1.5.2, the logo on the main homepage switched to the category logo. I removed the code for the category logo and the main logo re-appeared back to normal… it looks like the code you provided me is no longer working since i updated to version 1.5.2.

    Here’s the code im using below:

    add_filter( 'generate_navigation_logo', 'tu_category_logo' );
    function tu_category_logo() {
        if ( is_category( '3702' ) || in_category( '3702' ) ) {
            return 'http://theballerlife.com/wp-content/uploads/2017/09/baller-wives-life.png';
        }
    
        return 'http://theballerlife.com/wp-content/uploads/2016/12/blife1.png';
    }

    Thanks.

    #424157

    Leo Customer Support

    Hmm that code should still work.

    Can you add the code back in and link us to the page that isn’t working?

    Thanks!

    #424192

    Bobby

    Hi,

    I just put the code back in and the logo on the homepage switch to the category logo. When i take the code out, the original logo re-appears and the category logo disappears.

    http://theballerlife.com/

    #424250

    Tom Lead Developer

    Maybe try this:

    add_filter( 'generate_navigation_logo', 'tu_category_logo' );
    function tu_category_logo( $logo ) {
        if ( is_category( '3702' ) ) {
            return 'http://theballerlife.com/wp-content/uploads/2017/09/baller-wives-life.png';
        }
    
        return $logo;
    }
    #424429

    Bobby

    Hello Tom,

    It works but not like the other code. The code you gave me changes the logo on the specified category, but when a person clicks “read more” to go to the story, the logo switches back to the main logo. The other code covered all the logo changes. I tried the original code and just changed the “return” to $logo;…but that did not work.

    Any suggestions? Thanks.

    #424442

    Tom Lead Developer

    That code doesn’t cover being inside categories.

    For that, you’d need to do this:

    add_filter( 'generate_navigation_logo', 'tu_category_logo' );
    function tu_category_logo( $logo ) {
        if ( is_category( '3702' ) || in_category( '3702' ) ) {
            return 'http://theballerlife.com/wp-content/uploads/2017/09/baller-wives-life.png';
        }
    
        return $logo;
    }
    #424485

    Bobby

    Hi Tom,

    Yes, this is the code i tried and it changed the homepage logo back to the category logo. Strange??? Before I updated to the newest version 1.5.2…the prior code worked for everything. Hmmm….Should I go back to the last version??

    #424489

    Tom Lead Developer

    Definitely not. Try this instead:

    add_filter( 'generate_navigation_logo', 'tu_category_logo' );
    function tu_category_logo( $logo ) {
        if ( is_category( 'test-cat' ) || ( in_category( 'test-cat' ) && is_singular() ) ) {
            return 'http://theballerlife.com/wp-content/uploads/2017/09/baller-wives-life.png';
        }
    
        return $logo;
    }

    Just confirmed that it’s working 🙂

    #424511

    Bobby

    Perfect!!! It’s working again! Thanks for all your help.

    Take care.

    #424513

    Tom Lead Developer
Viewing 11 posts - 16 through 26 (of 26 total)

You must be logged in to reply to this topic.