wordpress - 使用 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.
我还没有编辑我的主页,几周前它运行良好。有没有人可以帮我解决这个问题?
解决方案
如果您在页面上使用任何短代码并且您正在获取该页面上的帖子并在 while 循环中循环通过帖子。请在循环结束后添加。
wp_reset_postdata();
代码将如下所示:
$posts= new WP_Query($args);
while ($posts->have_posts() ) : $posts->the_post();
.....
.....
.....
endwhile;
wp_reset_postdata();
没关系它是一个短代码,或者如果我们正在做类似上面的事情,请确保添加 wp_reset_postdata();
这是我经常遇到的问题之一。也可能有其他原因。
推荐阅读
- python - 代理身份验证 selenium ERR_TUNNEL_CONNECTION_FAILED
- swift - CGBitmapContext 比 CALayer 的 draw() 慢 2 倍
- node.js - 没有得到直接响应
- python - Python Round_down
- c# - 有没有办法在运行时接受未知类型?
- java - 如何在数组中添加很多东西?
- javascript - 改组选项后的按钮
- oracle - 如何在 macOS Catalina 10.15 上安装 SQL Developer?
- python - 将 Python 中的三个列表与排序结合起来
- python - mysql.connector 的 Python 编码问题 - 获取数据