douxianxing5712 2014-10-05 17:27
浏览 5

too long

When I add the following code to my single.php, the screen turns white.After debugging it gives the following error 'unexpected $end'. I have tried removing the parts of the code one by one and the error is due to the following code.Can't figure out what is wrong with it.

  <div class="relatedposts">  
     <h3>Related posts</h3>  
  <?php  
  $orig_post = $post;  
  global $post;  
  $tags = wp_get_post_tags($post->ID);  

  if ($tags) {  
  $tag_ids = array();  
  foreach($tags as $individual_tag) $tag_ids[] = $individual_tag->term_id;  
  $args=array(  
  'tag__in' => $tag_ids,  
  'post__not_in' => array($post->ID),  
  'posts_per_page'=>4, // Number of related posts to display.  
  'caller_get_posts'=>1  
  );  

  $my_query = new wp_query( $args );  

  while( $my_query->have_posts() ) {  
  $my_query->the_post();  
  ?>  

  <div class="relatedthumb">  
   <a rel="external" href="<? the_permalink()?>"><?php the_post_thumbnail(array(320,150)); ?><br/>  
    <?php the_title(); ?>  
    </a>  
    </div>  

  <? }  
     }  
   $post = $orig_post;  
   wp_reset_query();  
   ?>  
  </div>  
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 IAR程序莫名变量多重定义
    • ¥15 (标签-UDP|关键词-client)
    • ¥15 关于库卡officelite无法与虚拟机通讯的问题
    • ¥15 qgcomp混合物线性模型分析的代码出现错误:Model aliasing occurred
    • ¥100 已有python代码,要求做成可执行程序,程序设计内容不多
    • ¥15 目标检测项目无法读取视频
    • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
    • ¥100 求采集电商背景音乐的方法
    • ¥15 数学建模竞赛求指导帮助
    • ¥15 STM32控制MAX7219问题求解答