WordPress – single post template – display all posts

i’ve make a custom template (for single post), but it display all the posts, not the one i’ve been clicking on before.

here is my template :

Read More
<?php
 query_posts( 'post_type=catalogue');
 if ( have_posts() ) while ( have_posts() ) : the_post(); ?>    
<div class="header">
    <h1><?php echo get_the_term_list($post->ID,  'theme', '', '', ''); ?></h1>
</div>

<div class="main">
    <div class="categorie-title"><?php echo get_the_term_list($post->ID,  'theme', '', '', ''); ?></div>

    <div id="article-header">
        <h2><?php the_title(); ?></h2>
        <h3><?php echo get_the_term_list($post->ID,  'realisation', 'Un documentaire réalisé par ', ', ', '.'); ?></h3>
        <div class="duree"><?php echo get_post_meta($post->ID, 'Duree', true); ?></div>
    </div>

    <div class="gallerie-couvertures">  
<?php /*
$uploads = wp_upload_dir();
echo '<ul>';
if ($dir = opendir($uploads['basedir'].'/images-produits')) {
    $images = array();
    while (false !== ($file = readdir($dir))) {
        if ($file != "." && $file != "..") {
            echo '<li><img src="';
            echo $uploads['baseurl'].'/images-produits/'.$file;
            echo '" alt="" /></li>
                            ';
        }
    }
    closedir($dir);
}
echo '</ul>';
*/?>
    </div>

    <div class="section">
        <h2><?php the_title(); ?></h2>
        <h3><?php echo get_the_term_list($post->ID,  'realisation', 'Un documentaire réalisé par ', ', ', '.'); ?></h3>

        <div class="content">
                <?php the_content(); ?>
        </div>

        <ul id="film-description">
            <li><span>Genre: </span><?php echo get_the_term_list($post->ID,  'genre', ' ',',', '.'); ?></li>
            <li><span>Réalisation: </span><ul><?php echo get_the_term_list($post->ID,  'realisation', '<li>', '</li><li>', '</li>'); ?></ul></li>
            <li><span>Co-production: </span><ul><?php echo get_the_term_list($post->ID,  'co-production', '<li>', '</li><li>', '</li>'); ?></ul></li>
            <li><span>Année: </span><?php echo get_the_term_list($post->ID,  'date-de-sortie'); ?></li>
            <li><span>Couleurs: </span><?php echo get_the_term_list($post->ID,  'couleurs', '', ' - ', ''); ?></li>
            <li><span>Distribution: </span><?php echo get_the_term_list($post->ID,  'distribution', '', ', ', ''); ?></li>
        </ul>

    </div>

    <div class="section">
        <h3 class="uppercase">Extrait</h3>
            <?php echo get_the_term_list($post->ID,  'extrait'); ?>

        <div class="movie-preview-description">
            <h3><span><?php the_title(); ?></span> (trailer)</h3>
            <p><?php echo get_the_term_list($post->ID,  'realisation', 'Un documentaire réalisé par ', ', ', ''); ?> -  <?php echo get_post_meta($post->ID, 'Duree', true); ?> </p>
            <p><?php echo get_the_term_list($post->ID,  'date-de-sortie'); ?> - <?php echo get_the_term_list($post->ID,  'distribution', '', ', ', ''); ?></p>
        </div>
        <div class="social-links">
            <h4>Partagez</h4>
            <ul>
                    <?php $args = array(
                            'orderby'        => 'id',
                            'order'          => 'ASC',
                            'category_name'  => 'Social') ?>
                    <?php $socials = get_bookmarks($args);
                    foreach ($socials as $value) {

                        echo '<li><a href="'.$value->link_url.'" class="'.$value->link_name.'" target="_blank">'.$value->link_name.'</a></li>';
                    }

                    ?>
            </ul>
        </div>

        <div class="voir-vodeo">
            <h4>Regarder sur VODEO</h4>
            <a href="<?php echo get_post_meta($post->ID,  'VODEO', TRUE);?>" class="vodeo" target="_blank" >Vodeo</a>
        </div>

    </div>
</div>

<?php endwhile;// End the loop. Whew. ?>


<?php wp_reset_query();?>

I think, i’ve miss something with the loop, any ideas?

Related posts

Leave a Reply

1 comment

  1. Well, i find the problem… I don’t need to specify what post_type is, because i click on it. I don’t need any query, i ve just delete this : query_posts( 'post_type=catalogue');.