Shortcode in php template
-
Hi
Great plugin.
I have a site with multiple walking routes. I have created a custom post type for the routes. I am trying to add a map to each route, each with a different .gpx file. I have created a custom field on the route post type for the url of the .gpx file.
I have tried many ways to replace the url in the shortcode below with the url in the custom field (the_field, using a variable, putting the entire shortcode in a custom field, etc.) but I cannot get it to work.
echo do_shortcode(‘[osmap gpx=”https://site/file.gpx”%5D’);
What I want to do is add the .gpx file to the custom field of each route and then use the template and shortcode to display the right map on the right page.
My php is limited, so any help would be greatly appreciated.
Many thanks
- The topic ‘Shortcode in php template’ is closed to new replies.