首页 > 解决方案 > 使用 elementor 在我的页面中找不到内容区域

问题描述

我刚开始使用 Wordpress,几周前我发布了一个网站。今天我想编辑主页,但我收到以下错误:

Sorry, the content area was not found in your page. You must call the_content function in the current template, in order for Elementor to work on this page.

我还没有编辑我的主页,几周前它运行良好。有没有人可以帮我解决这个问题?

标签: wordpresselementor

解决方案


如果您在页面上使用任何短代码并且您正在获取该页面上的帖子并在 while 循环中循环通过帖子。请在循环结束后添加。

wp_reset_postdata();

代码将如下所示:

$posts= new WP_Query($args);
while ($posts->have_posts() ) : $posts->the_post();
  .....
  .....
  .....
endwhile;
wp_reset_postdata();

没关系它是一个短代码,或者如果我们正在做类似上面的事情,请确保添加 wp_reset_postdata();

这是我经常遇到的问题之一。也可能有其他原因。


推荐阅读