• Resolved mYrAn

    (@myran)


    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)
  • 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

    (@myran)

    Yeah, i think we’re trying to achive the same thing! Like a lightbox with the content in.

    Thread Starter mYrAn

    (@myran)

    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.

    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.