I am trying to use shortcodes within a modal window. The code is inside of a separate php file. I am getting a Fatal error: Call to undefined function
This is the modal link which works fine:
<a class="model-link" href="<?php bloginfo( 'template_url' ); ?>/location-modal.php">Location</a>
location-modal.php looks like this:
<div class="location-modal ">
<h1 class="modal-title">Heading</h1>
<p class="modal-para">test</p>
<?php echo do_shortcode('[MYSHORTCODE]'); ?>
</div>
How can I get this working?
This did the trick.
You need to include your PHP file which contains the
do_shortcode
function. Do something like this: