Want to add WordPress Post Previews into your modals? You’ve come to the right place!
In the current iteration of Easy Modal, doing this requires some custom code, and this guide is going to present that code so you can have your post preview in your modals!
First, we’re going to be using a modified version of WordPress’ The Loop PHP – read more here: http://codex.wordpress.org/The_Loop. So, wherever you want you’re Post Preview to be displayed in a modal with a read more link, you will replace your existing Loop PHP with this modified version of that code in your template.
This is a modified WordPress Loop to have Post Previews in your popups:
[php]<?php while ( have_posts() ) : the_post();?>
<h2><a class="eModal-post-<?php the_ID();?>" href="<?php the_permalink();?>"><?php the_title();?></a></h2>
<?php echo do_shortcode("[modal id='post-". get_the_ID() ."' size='small' title='". get_the_title() ."']". get_the_content() . "[/modal]");?>
<?php endwhile; ?>[/php]
This loop includes the modal short code, so it creates popups on the fly, and there is no need to add any eModal-# classes to any elements. Simply replace your current loop with this modified version and it will work out-of-the-box!