这是我的php代码
<?php
get_header(); ?>
<div id="primary" class="content-area col-md-8">
<main id="main" class="site-main" role="main">
<?php get_template_part( 'content', 'page' ); ?>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
它显示了一个错误,分析错误:语法错误,第23行/home/content/50/8454750/html/wp-content/themes/market/page.php中出现意外的T_ENDWHILE。。请帮我
thanks,
jini
您忘记添加while循环
<?php while ( have_posts() ) : the_post(); ?> // add this line
<?php get_template_part( 'content', 'page' ); ?>
<?php endwhile; // end of the loop. ?>
<?php get_template_part( 'content', 'page' ); ?>
删除此行-
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
删除
<?php endwhile; // end of the loop. ?>
这将解决你的问题。