PDA

View Full Version : معنی این ارور



amirali0079
چهارشنبه 24 دی 1393, 16:44 عصر
کجای حلقه مشکل داره ؟
Parse error: syntax error, unexpected 'endwhile' (T_ENDWHILE) in C:\xampp\htdocs\Blog\wp-content\themes\DemoAmirali\index.php on line 29
-

<?php if(have_posts()):?>
<?php while(have_posts()) ?>
<?php the_post(); ?>
<article class="col col-lg-8 col-sm-8">
</article>
<?php endwhile; ?>
<?php endif; ?>

masiha68
چهارشنبه 24 دی 1393, 16:53 عصر
{} رو یادت رفته http://php.net/manual/en/control-structures.while.php
یا دو نقطه while(have_posts()):
یه نگاهی به لینک بنداز

id1385
چهارشنبه 24 دی 1393, 17:59 عصر
شکل صحیح استفاده:


if (have_posts()) :
while (have_posts()) : the_post();
// loop [ loop result(s)]
endwhile;
else:
// statement [if no result]
endif;