Title: jQuery post popup
Last modified: August 19, 2016

---

# jQuery post popup

 *  Resolved [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/jquery-post-popup/)
 * Hi! Im looking for a solution giving me the ability to view a post in a jquery
   generated popup. I want the post to show the post thumbnail and the exerpt with
   a button stating “view project” (which i have got working), and when i click 
   it the full post will pop up in a window infront of everything. Is this possible?
   Will the jquery get “the loop” and open the right content even though theres 
   more than one contentbox? Hope you understand what i mean.. Thanks in Advance!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [siebenhundertsechs](https://wordpress.org/support/users/siebenhundertsechs/)
 * (@siebenhundertsechs)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/jquery-post-popup/#post-1510532)
 * hej myran
 * i think i have some kind of the same issue.
    I also want do display a post using
   javascript, but on the same site.
 * The problem is, that i can’t figure out, how to tell wordpress to show one post,
   without changing all the site.
    I think, that the information, which post to 
   display is coming from the URL(p.e: /wordpress/?p=201 –> post with ID 201 is 
   shown).
 * So I want to tell functions like the_content() (which is creating the post) via
   javascript another value for “p”.
 * Unfortunately I did not figure out, how to do this. Maybe someone else can help.
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/jquery-post-popup/#post-1510533)
 * Yeah, i think we’re trying to achive the same thing! Like a lightbox with the
   content in.
 *  Thread Starter [mYrAn](https://wordpress.org/support/users/myran/)
 * (@myran)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/jquery-post-popup/#post-1510560)
 * I have now found the solution! Here’s how to do it for everybody that wants to
   do simular things. Im using ajax to get the info, and fancybox to display it.
   Initiate fancybox the usual way.
 * Where the content should be displayed you do like this:
 *     ```
       <?php the_post_thumbnail(); ?>
        <?php the_excerpt(); ?>
        <a href="<?php the_permalink() ?>" class="popup" title="<?php the_title(); ?>">Popup</a>
       ```
   
 * Add this to the head:
 *     ```
       <script type="text/javascript">
       $(document).ready(function() {
       $(".popup").fancybox({
       'transitionIn'	: 'fade',
       'transitionOut'	: 'fade'
       });
       });
       </script>
       ```
   
 * I think that’s right. Remember to make it a class, otherwise it will only show
   up in one post. Then you edit single.php to display what you want.
 *  [salaramiry](https://wordpress.org/support/users/salaramiry/)
 * (@salaramiry)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/jquery-post-popup/#post-1510798)
 * Hi do you think you could make a tutorial and post it somewhere with a few screenshots?
   If it’s not too much to ask, so that newbies like me can benefit from this. Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘jQuery post popup’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [salaramiry](https://wordpress.org/support/users/salaramiry/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/jquery-post-popup/#post-1510798)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
