Support » Themes and Templates » Single.php in a Popup

  • Hi everybody!!

    I’m doing a single page site (Argh!). Until now I was able to do everything, but I would like to open the individual post in a popup overlay on the page.
    I added this code to call up the single.php inside the popup:

    <?php include (TEMPLATEPATH . '/single.php'); ?>

    but when it opens, it loads the entire loop of articles 🙁
    Can be because it is inside the loop in the index?
    Someone can help me?

    This is the code of the entire loop:

    <div class="newsBox1" id="container">
    			 <?php query_posts(array('category__and' => array(1))); if (have_posts()) : while (have_posts()) : the_post(); ?>
                      <div class="box col1">
                            <p class="newsData"><?php the_time('j F Y') ?></p>
                            <h3 class="newsTitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
                            <br />
                            <?php if ( has_post_thumbnail()) : ?>
                               <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
                               <?php the_post_thumbnail(); ?>
                            <?php endif; ?>
                            <p class="news"><?php the_excerpt(); ?></p>
                            <div class="btnLeft"><a href="#" class="toPopup">Vedi tutto</a></div>
                            <div class="ffix"></div>
                <?php endwhile; ?>
                <?php endif; ?>
    <!--POP UP-->
    <div id="toPopup">
    	<div class="close"></div>
        	<span class="ecs_tooltip">Chiudi <span class="arrow"></span></span>
    		<div id="popup_content">
    			<?php include (TEMPLATEPATH . '/single.php'); ?>
    <!--POP UP END-->

    Thank you all for the support!
    Lot of love.

  • The topic ‘Single.php in a Popup’ is closed to new replies.