contents of page.php does not show in wordpress

2019-08-23 22:11发布

I have updated my site on localhost and uploaded to server (000Webhost) then the contents of page.php(all other template as well) does not show anymore. However it still work fine on localhost. I thought something gone wrong in Wordpress on server so I have deleted database and recreate them and also reinstall Wordpress and then uploaded my theme but still not working. Does anyone know what is happening and what I am doing worng?? My page.php is very simple like this below, Oh the title is showing but not the contents.

<?php get_header(); ?>
<div id="content">
<h1 class="entry-title"><?php the_title(); ?></h1> 
<p>
 <?php the_content(); ?>
</p>
  <div style="clear:both;"></div>
</div>

<?php get_footer(); ?>

here is the site.

http://ahi.webatu.com/?page_id=12

Thank you very much in advance!!

标签: wordpress
1条回答
ゆ 、 Hurt°
2楼-- · 2019-08-23 22:41

You need to be in the_post() scope to use the_content() function as you want

<?php if( have_posts() ) : the_post(); ?>

<?php the_content(); ?>

<?php endif; ?>
查看更多
登录 后发表回答