【问题标题】:WordPress custom theme errors with showing content显示内容的 WordPress 自定义主题错误
【发布时间】:2020-06-01 21:49:49
【问题描述】:

Wordpress index.php 错误

<?php
get_header();
get_content();
get_footer();
?>

footer.php 没有显示,当我删除get_content() 页脚时工作正常。

【问题讨论】:

  • 你能检查一下 content.php 文件中可能导致错误的内容吗?可能是页脚的两次调用???
  • 请添加您的page.php文件的代码

标签: php wordpress


【解决方案1】:

你可以尝试添加while循环:

while ( have_posts() ) :

    print_r(get_the_content())


endwhile; // End the loop.

成功了。我查过了。

【讨论】:

    【解决方案2】:

    这个while不工作。

    当我试图把这个

       <?php get_header(); ?>
    <?php get_header('content'); ?>
    <?php get_footer('footer'); ?>
    

    已创建 header-content.php 文件。页脚已停止,未显示,内容仅显示前 5 行

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-06-13
      • 2019-05-11
      • 1970-01-01
      • 2014-06-20
      • 1970-01-01
      • 2016-09-22
      • 2016-07-17
      • 1970-01-01
      相关资源
      最近更新 更多