我的博客文章有时会在多个实例中输出。这是随机发生的,但当它发生时,我唯一的解决方案是删除帖子,然后再次转发它。
问题可以在这里看到:http://experienceinvest.com/british-student-housing-investment-to-hit-5-75bn/
我的single.php文件:
<?php if ( have_posts() ) { the_post(); rewind_posts(); } ?>
<?php
if ('investment' == get_post_type()) { include("investment-single.php");}
else { include("news-single.php"); }
?>发布于 2015-11-03 19:40:38
解决方案:
single.php和single模板文件invstment single.php&-single.php的内容需要包装在以下循环中。
<?php if ( have_posts() ) : the_post(); rewind_posts(); ?>
<!--The page content goes here-->
<?php endif; ?>https://stackoverflow.com/questions/33497609
复制相似问题