[Resolved] Header Logo with image map, generate_after_header problem

Home Forums Support [Resolved] Header Logo with image map, generate_after_header problem

Home Forums Support Header Logo with image map, generate_after_header problem

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #512803
    Rado

    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: Logo is placed below the navigation
    In source view one can see that the code was not inserted before the closing header tag.
    Source view
    What am I doing wrong here?

    Appreciate your help. Best regards, Rado

    GeneratePress 2.0.2
    GP Premium 1.5.6
    #513062
    Tom
    Lead Developer
    Lead Developer

    Perhaps try adding it to the After Header Content hook? It’s a GP Hook, so you can find it in “Appearance > GP Hooks”.

    #513091
    Rado

    Thanks, there it does work its magic now… And it is way easier than adding a custom function to functions.php.

    #513403
    Tom
    Lead Developer
    Lead Developer

    Awesome! Glad I could help 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.