Post Preview with Shortcode Not Working
-
I am trying to use the instructions on this page of the documentation to create popups with content from a custom post type. The issue I’m having is that the IDs of the popups are not matching the IDs of the original posts.
Here is my shortcode in the template file:
echo do_shortcode('[popup id="'.get_the_ID().'" size="medium" title="'.get_the_title().'"]'.$modal_content.'[/popup]');
This is being called inside the page’s loop.
What is happening is that the IDs of the popups are changing with every page reload, and are not even related to the original post ID. They all start with “pum–” and then have a random 4-digit number following the double dashes.
Any ideas what’s going on?
The page I need help with: [log in to see the link]
- The topic ‘Post Preview with Shortcode Not Working’ is closed to new replies.