Skip to content

Instantly share code, notes, and snippets.

@amitabhaghosh197
Last active August 29, 2015 14:04
Show Gist options
  • Save amitabhaghosh197/43b2d86e6cda19e55f12 to your computer and use it in GitHub Desktop.
Save amitabhaghosh197/43b2d86e6cda19e55f12 to your computer and use it in GitHub Desktop.
Bootstrap Modal
<div class=" modal hide fade" id="myModal" >
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
</div>
<div class="modal-body">
<?php
$args = array(
'post_type' => 'pop-ups',
'order' => 'DESC',
);
$the_query = new WP_Query( $args );
if($the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
<div >
<!---<div style="width:100%;"> <img src="<?php //echo wp_get_attachment_url(get_post_thumbnail_id($post->ID,'')); ?>"></div>---> <p><?php the_title(); ?></p>
<p><?php the_content() ;?></p>
</div> <!------/.students-quotes 1------------------------>
<?php wp_reset_postdata(); ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal" aria-hidden="true">Close</a>
</div>
</div>
//Since My Modal is window on load so add
jQuery(window).load(function($){
jQuery('#myModal').modal('show', function(e){
if(!data) return e.preventDefault();
} );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment