Site logo

Archived topic

I want to hook a HTML logo into the navigation on mobile

6 replies · Started by Streater on June 15, 2021

Viewing posts 1–7 of 7

I created my logo in custom HTML (class = mobile-logo-row) in the header widget and want to hook it into my mobile menu... with I assume the container (generate_before_header_content).

I tried a bunch of hook ideas… this one seemed the most logical but didn’t work. Any ideas?

<?php
add_action(‘generate_before_header_content’, function(){
do_action (‘mobile-logo-row’);}
);

?>

Hi there,

I wonder if there is a better way to go about this.

What exactly are you trying to achieve?

Can you link me to the page in question?

Yes, there are multiple reasons why I want to place the logo with HMTL instead of using the default logo customizer.
1) My desktop logo settings are coded on an HTML sidebar and have separate settings... and I don't want to use display: none to go about removing the default logo on desktop.
2) I want to add image sizing in HTML
3) I want to add target="_blank"(which doesn't seem to be working for any links on the site but that is a different topic) and add
4) AND I want to do a fixed header and it will only be possible doing this according to this thread: https://generatepress.com/forums/topic/change-logo-media-source-file-when-sticky/#post-304545

In private information (do links show for you here???): I provided link to my working GeneratePress site and you can see exactly how I want things to look and act on my original site built in DIVI

Hi there,

If it's solely for replicating the layout of the DIVI site you've provided on mobile, you can just enable Mobile header on Appearance > Customize > Layout > Header and set its own logo from there.

But if you really must change where the logo is placed, simply remove the logo you've assigned on customizer's site identity and use Tom's code on the link you've found.

Oh thanks... that Header Customizer works but how do I add a home page link to that? That's what I wanted to do with HTML...

Oh wait just noticed it linked as a default. Works perfect thanks!

No problem. Glad you got it sorted. :D

This archived topic is closed to new replies.