- This topic has 18 replies, 6 voices, and was last updated 7 years, 1 month ago by
Leo.
-
AuthorPosts
-
April 10, 2017 at 4:22 pm #304230
Marie Odile
Hi,
I was wondering if it’s possible to change the image source file for the sticky menu. It looks by default it’s always the same image for the logo on the main navigation and on the sticky navigation.
Thanks,
JesusApril 10, 2017 at 8:11 pm #304296Tom
Lead DeveloperLead DeveloperThe navigation logo/sticky navigation logo are the same image I’m afraid.
I’ll definitely put some thought into this though, might be able to come up with something 🙂
April 10, 2017 at 11:34 pm #304349Marie Odile
Thanks!
IF you have any idea on how to achieve it via hooks or similar let me know.
JesusApril 11, 2017 at 9:35 am #304545Tom
Lead DeveloperLead DeveloperYou could do something using hooks..
add_action( 'generate_inside_navigation','tu_navigation_logos' ); function tu_navigation_logos() { ?> <div class="sticky-logo navigation-logo"> <img src="URL TO NAVIGATION LOGO" alt="" /> </div> <div class="sticky-logo navigation-logo sticky-only"> <img src="URL TO STICKY NAVIGATION LOGO" alt="" /> </div> <?php }
Then some CSS:
.navigation-logo.sticky-only { display: none; } .navigation-stick .navigation-logo.sticky-only { display: block; } .navigation-stick .navigation-logo:not(.sticky-only) { display: none; }
Something like that should work.
February 28, 2018 at 2:49 pm #508371mike
Hello guys,
How can i use this on the homepage only?
Thanks
February 28, 2018 at 8:10 pm #508494Leo
StaffCustomer SupportIs your home page a static home page or a blog page?
February 28, 2018 at 11:45 pm #508580mike
Static
March 1, 2018 at 6:08 am #508802Leo
StaffCustomer SupportTry this for the snippet:
add_action( 'generate_inside_navigation','tu_navigation_logos' ); function tu_navigation_logos() { ?> <?php if ( is_home() ) : ?> <div class="sticky-logo navigation-logo"> <img src="URL TO NAVIGATION LOGO" alt="" /> </div> <div class="sticky-logo navigation-logo sticky-only"> <img src="URL TO STICKY NAVIGATION LOGO" alt="" /> </div> <?php endif; ?> <?php }
March 1, 2018 at 10:20 am #509062mike
Hey,
The regular snippet works fine, this made the logo disappear
any idea?
i did leave ‘add_action( ‘generate_inside_navigation’,’tu_navigation_logos’ );’ and still nothing
Thanks
March 1, 2018 at 3:11 pm #509244Leo
StaffCustomer SupportTry this CSS to go with the snippet instead:
.home .navigation-logo.sticky-only { display: none; } .home .navigation-stick .navigation-logo.sticky-only { display: block; } .home .navigation-stick .navigation-logo:not(.sticky-only) { display: none; }
April 17, 2018 at 2:38 am #552494celito
Hi Tom, we had a slight makeover, one of which was redesigning the logo. I can’t make it to show in the sticky menu. Instead the previous logo is still showing in the sticky menu, even if this has been deleted from the media library. If I remember right, wasn’t there a facility in the customizer before to change the sticky logo? I tried following the suggestion in your reply of April 11, 2017 to Marie, above, but wasn’t able to make it work. Any help will be greatly appreciated. Thanks.
Celito
April 17, 2018 at 8:55 am #552854Leo
StaffCustomer SupportHi Celito,
That sounds like a caching problem to me.
Any chance you can open a new topic and link us to your site?
Thanks!
April 18, 2018 at 6:03 am #553660celito
I’ll check the cache first, and open a new topic if it does not work. Thanks.
Celito
April 18, 2018 at 6:52 am #553698celito
Hi Leo, just for my curiosity to what file should I add the hooks described? Maybe this is where I went wrong.
Celito
April 18, 2018 at 8:54 am #553890Leo
StaffCustomer SupportOne of these method: https://docs.generatepress.com/article/adding-php/
Again please open a new topic for further assistance 🙂 Thanks!
-
AuthorPosts
- The topic ‘Change Logo media source file when sticky’ is closed to new replies.