Link to Post from Map Bubble / InfoWindow

This topic contains 6 replies, has 3 voices, and was last updated by  Paolo 9 years, 6 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #50334

    Wayne Harvey
    Expired Member
    Post count: 102

    Hi there
    I want to be able to put a “Read more…” or something similar within the map marker bubble. Is there an easy way to do this. I’m aware that the post title already links to the post but I’m wanting to be sure that users know that there’s more.
    Thanks

    #50346

    Paolo
    Site Admin
    Post count: 31211

    The map info window has just been rebuilt, so I’m not sure if hooks have changed. I’ll ask to Stiofan to let us know,

    Thanks

    #50365

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi Wayne,

    I think the hook you want could be

    do_action('geodir_infowindow_meta_after',$postinfo_obj,$post_preview );

    So something like:

    
    
    add_action('geodir_infowindow_meta_after','my_theme_add_infowindow_meta',10,2);
    
    function my_theme_add_infowindow_meta($postinfo_obj,$post_preview ){
    echo "<a href='#'>Read More...</a>";
    }

    Thanks,

    Stiofan

    #50920

    Wayne Harvey
    Expired Member
    Post count: 102

    Hi Stofan,
    Thanks for your help. The code provided puts a blank or null link in the infowindow but it does not link to the post. Any more ideas? Thanks.
    Wayne

    #50943

    Paolo
    Site Admin
    Post count: 31211

    please change this part :

    echo "<a href='#'>Read More...</a>";

    with:

    echo "<a href=' ".get_the_permalink()." '>Read More...</a>";

    Thank you

    #50947

    Wayne Harvey
    Expired Member
    Post count: 102

    Works beautifully, many thanks. Wayne

    #50948

    Paolo
    Site Admin
    Post count: 31211

    You are welcome! 🙂

Viewing 7 posts - 1 through 7 (of 7 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount