[英]WordPress custom theme, Why is my content not showing on page
My pages are not showing any content on them other then the header and footer I think its something to do with the way i am laying out my but don't really know. 除页眉和页脚之外,我的页面上没有显示其他内容,我认为这与我布局我的方式有关,但我并不十分了解。
index.php and page.php index.php和page.php
<?php get_header(); ?>
<?php if( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endif; ?>
<?php get_footer(); ?>
You forgot while
statement. 你忘了
while
声明。
Here's how your code should look: 这是代码的外观:
<?php get_header(); ?>
<?php if( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
<?php get_footer(); ?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.