- This topic has 18 replies, 6 voices, and was last updated 5 years, 8 months ago by Leo.
-
AuthorPosts
-
April 10, 2017 at 4:22 pm #304230Marie 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 #304296TomLead 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 OdileThanks!
IF you have any idea on how to achieve it via hooks or similar let me know.
JesusApril 11, 2017 at 9:35 am #304545TomLead 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 #508371mikeHello guys,
How can i use this on the homepage only?
Thanks
February 28, 2018 at 8:10 pm #508494LeoStaffCustomer SupportIs your home page a static home page or a blog page?
February 28, 2018 at 11:45 pm #508580mikeStatic
March 1, 2018 at 6:08 am #508802LeoStaffCustomer 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 #509062mikeHey,
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 #509244LeoStaffCustomer 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 #552494celitoHi 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 #552854LeoStaffCustomer 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 #553660celitoI’ll check the cache first, and open a new topic if it does not work. Thanks.
Celito
April 18, 2018 at 6:52 am #553698celitoHi 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 #553890LeoStaffCustomer 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.