2010-12-08 87 views
0

Hé, je ne suis pas très bien avec PHP, assez novice. Mais cela signale une erreur.Wordpress Loop - Top 4 messages ont une structure différente (ERREUR PHP)

<?php if (have_posts()) : while (have_posts()) : the_post(); 
        $loopcounter++; ?> 

      <?php if ($loopcounter == 1) { ?> 
       <section class="post" class="postFeatured"> 
       <h1 class="post"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1> 
      <?php } else { ?> 
       <section class="post" class="postSmall"> 
       <h2 class="post"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> 
      <?php } ?> 

        <div class="image"> 
         <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>" class="imgHolder"> 
          <div class="img"> 
           <div class="cc"><span class="number"><?php comments_number('0', '1', '%'); ?></span><span class="txt">COMMENTS</span></div> 
           <?php $image = get_post_meta($post->ID, 'image', true); ?> 
           <img src="<?php echo $image; ?>" alt="<?php the_permalink() ?>" /> 
          </div> 
         </a> 
        </div> 

        <ul class="postDetail"> 
         <li class="dateAuth"> 
          <div class="dMY"><?php the_time('d M Y') ?></div> 
          <div class="author">Posted by <?php the_author_posts_link() ?></div> 
         </li> 
         <li class="categories"> 
          <div class="cats"><?php the_category(', ') ?></div> 
         </li> 
        </ul> 

        <div class="entry excerpt"> 
         <?php the_excerpt(); ?> 
         <a href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>" class="read-more">Read Article</a> 
        </div> 

       </section> 
      <?php } endwhile; endif; ?> 

Vous ne savez pas pourquoi, quelqu'un peut-il m'aider?

REDUIT

<?php if (have_posts()) : while (have_posts()) : the_post(); 
     $loopcounter++; ?> 
     <div class="post"> 
<?php if ($loopcounter == 1) { ?> 
     <h1 class="first"><?php the_title(); ?></h1> 
<?php } else { ?> 
     <h1 class="second"><?php the_title(); ?></h1> 
<?php } ?> 
     <?php the_content(); ?> 
     </div> 
<?php } endwhile; endif; ?> 

erreur finit par être: <?php } endwhile; endif; ?>

+0

Quelle est l'erreur exactement? Pouvez-vous réduire la taille de l'exemple? –

+0

Mis à jour, hmmmm. – Daryl

+0

Quelle est l'erreur exactement? –

Répondre

3

perdre l'accolade de fermeture qui précède le endwhile. Le endif est également redondant.

+0

Merci génial, stupidité de ma part. – Daryl

1

La dernière accolade avant la fin ne correspond à aucune accolade ouvrante.