Archived topic
Header Logo with image map, generate_after_header problem
3 replies · Started by Rado on March 6, 2018
Hi Tom,
I would like to use an image with an image map as header logo. I added this code to my functions.php:
add_action( 'generate_after_header', 'header_thingy');
function header_thingy() {
echo '<div id="wrap-hotspots-image-3385"><img width="370" height="216" src="https://i2.wp.com/gutding.org/wp-content/uploads/2018/02/Logo_mit_Shop_370px.png?zoom=2&fit=370%2C216&ssl=1" class="header-image" usemap="#hotspots-image-3385" data-event-trigger="click" data-highlight-color="#ae9a5d" data-highlight-opacity="0.1" data-highlight-border-color="#ffffff" data-highlight-border-width="-1" data-highlight-border-opacity="1.01" data-no-lazy="1" data-lazy="false" scale="0"></div>';
echo '<map name="hotspots-image-3385" class="hotspots-map"><area shape="poly" coords="17,203,16,120,198,105,196,123,204,136,225,177,228,195" href="https://gutding.org" title="Home" data-action="url" target="" class="url-area" id="hotspots-image-3385-area-1"><area shape="poly" coords="198,123,220,103,214,70,201,64,200,12,273,18,327,26,359,59,356,91,337,116,298,131,259,134,212,131" href="https://gutding.org/shop/" title="Shop" data-action="url" target="" class="url-area" id="hotspots-image-3385-area-2"></map>';
When I delete my regular header logo, I get this: 
In source view one can see that the code was not inserted before the closing header tag.

What am I doing wrong here?
Appreciate your help. Best regards, Rado
Perhaps try adding it to the After Header Content hook? It's a GP Hook, so you can find it in "Appearance > GP Hooks".
Thanks, there it does work its magic now... And it is way easier than adding a custom function to functions.php.
Awesome! Glad I could help :)