這是WordPress主題的index.php我的PHP代碼:解析錯誤:語法錯誤,意外的文件結束,但沒有錯誤
<section id="content">
<?php
$i=1;
while(have_posts() && i < 7):the_post();
$tumbUrl = '';
if(has_post_thumbnail())
{
$tumbUrl = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
}
if(i < 4):
?>
<div id="row1">
<div id="tile<?echo $i?>" class="tile">
<div id="img<?echo $i?>" class="tileimage"<?if($tumbUrl != ''):?> style="background-image:<?echo $tumbUrl; ?>"<?endif;?>></div>
<div id="text<?echo $i?>" class="tiletext"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
</div>
</div>
<?
else:
?>
<div id="row2">
<div id="tile<?echo $i?>" class="tile">
<div id="img<?echo $i?>" class="tileimage"<?if($tumbUrl != ''):?> style="background-image:<?echo $tumbUrl; ?>"<?endif;?>></div>
<div id="text<?echo $i?>" class="tiletext"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></div>
</div>
</div>
<?
endif;
endwhile;
?>
</section>
,當我要運行它,我得到的錯誤說,Parse error: syntax error, unexpected end of file in C:\wamp\www\wordpress\wp-content\themes\Odatis\index.php on line 31
,但我無法找到任何錯誤。
任何人都可以幫助我嗎?
(我的PHP版本是5.4.3)
'short_open_tag = ON'但錯誤是一樣的! (它是'關',我把它改爲'開') – 2013-03-27 11:19:43
「在較新的PHP版本其默認禁用」 - 什麼? – Shoe 2013-03-27 11:21:10
通常你的php.ini中有多個值。搜索第二個值。 – Stony 2013-03-27 11:21:55