php – How can I get values from a custom post type depending on where I click on my SVG map?
Here’s what I would like to achieve (desktop only) : https://www.icifaubourgboisbriand.com/en/stores/
When I click on my SVG map, I would like to display an information card for each store.
I have already created my custom post type “stores” and also the card HTML.
<div class="store-card"> <div class="content"> <div class="address"> <span>Address</span><br> <span><?php the_field('store_address'); ?></span> </div> <div class="opening-hours"> <span><?php the_field('store_opening_hours'); ?></span><br> </div> </div> </div>
But now I don’t know how to get my values for each store created in my CPT. How can I do that ? For instance, when I click on a specific store, I want its name and its opening hours to be displayed. I haven’t figured out how to make it happen.
Many thanks !