mapping just the search results
-
Hello Camille,
I’m trying to set up a search.php template, shoxing the results of a search.
I’m adapting that from the underscores theme.
The above example shows the results of a search for “Assouan” (4 articles). My dream would be presenting a map with only the markers corresponding to these articles.I tried to insert this shortcode on top of the template, but it shows the markers corresponding to all articles of the blog. The inserted line was :
<?php echo do_shortcode( ‘ [travelers-map minzoom=3 width=100% height=100vh post_types=post,page tileurl=”https://{s}.tile.jawg.io/jawg-dark/{z}/{x}/{y}{r}.png?access-token=EDiK4LQEjFpT2p7S06fbibeGK6KTsbSPR7hYkaMQYj9VfeswuOoxJOFXlL9NkI6E” subdomains=”abc” attribution=\’\’ title=”Tiles Courtesy of Jawg Maps” target=”_blank” ] ‘ );?>
Probably it should be inserted inside the loop, but all it did was repeating the whole thing for every article. I feel that I should somehow tell the shortcode to apply the current query, but I don’t kn ow how to do that.
Can you advise a direction for me ?Thank you in advance !
The page I need help with: [log in to see the link]
The topic ‘mapping just the search results’ is closed to new replies.