2011-02-12 103 views
0

为什么我会在意外时遇到?

<?php 
     $loop = new WP_Query(array('post_type' => 'portfolio', 'posts_per_page' => -1)); 
     while ($loop->have_posts()) : $loop->the_post(); 

     $custom = get_post_custom($post->ID); 
     $special_notes = $custom["special_notes"][0]; 
     $website_url = $custom["website_url"][0]; 
     $view_more = $custom["view_more"][0]; 
    ?> 

    <article class="project"> 
     <section class="thumbnail"> 
      <?php the_post_thumbnail(); ?> 
      <section class="description"> 
       <hgroup> 
        <h2><?php the_title(); ?></h2> 
        <h3> 
         <?php 
         $terms_as_text = get_the_term_list($post->ID, 'Skills', '', ', ', '') ; 
         echo strip_tags($terms_as_text); 
         ?> 
        </h3> 
       </hgroup> 
       <?php the_content(); ?> 
       <p class="star"><?=$special_notes?></p> 
       <span> 
        <?php if (!empty($website_url)) { echo 'Launch <a href="' . $website_url . '" target="_blank">Website<a>' ?> | Read <a href="<?=$view_more?>" target="_blank">more</a> about this project 
       </span> 
      </section> 
     </section> 
    </article> 

    <?php endwhile; ?> 

</section> 

我得到35行意外ENDWHILE有人能帮助我吗?

回答

1

第29行缺少},是我的猜测。

+0

谢谢,我加入了缺失的支架。但是,由于html出错了,其他的东西一定是错的。这是我更新的代码。你看到有什么不对吗? http://pastebin.com/TrawVzxB – J82 2011-02-12 03:15:29

0

29行上不匹配的大括号;你不关闭你的if {。

相关问题