WordPress:帖子/页面列表未显示在 wp-admin 面板中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7388712/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
WordPress: Posts / Pages list not showing in wp-admin panel
提问by Joshua F. Rountree
I have somewhat caused a weird issue. I moved a client to a different server. Upgraded wordpress + database. Little did I know, I was actually updating the database on the previous server due to the config having a hardcoded mysql IP address.
我有点引起了一个奇怪的问题。我将客户端移到了不同的服务器。升级的 wordpress + 数据库。我几乎不知道,由于配置具有硬编码的 mysql IP 地址,我实际上是在更新以前服务器上的数据库。
So I resolved that in the config, then it asked to update the database.
所以我在配置中解决了这个问题,然后它要求更新数据库。
Now it doesn't show posts / pages in admin but the counts still show up in the "All" "Published" links.
现在它不会在管理员中显示帖子/页面,但计数仍然显示在“全部”“已发布”链接中。
Is there a bit or "status" that didn't get set in the database update? Something that is preventing these from showing in admin.
是否有一些或“状态”没有在数据库更新中设置?阻止这些显示在管理员中的东西。
They show up fine on the front webpage.
他们在前面的网页上显示得很好。
Any help would be appreciated!
任何帮助,将不胜感激!
UPDATE: Created a new post after upgrade and the count increased to 13 but still says "No Posts". :-\
更新:升级后创建了一个新帖子,数量增加到 13,但仍然显示“无帖子”。:-\
UPDATE: Links & Comments both show up with a huge list. Posts, Pages, and Media do not show up.
更新:链接和评论都显示一个巨大的列表。帖子、页面和媒体不显示。
Maybe this has to do with the post_author index they WordPress added?
I verified the user existed with matching ID. :-\
也许这与他们 WordPress 添加的 post_author 索引有关?我验证了用户存在匹配的 ID。:-\
采纳答案by Marty
best thing to do, if its still possible, is on the old server, do an export from within your tools admin menu,
最好的办法,如果它仍然可能,是在旧服务器上,从你的工具管理菜单中导出,
on the new server do a fresh install, and do an import using the same method, once wordpress downloads and activates the plugin for the import just upload your wordpress file, during the import assign the users to either current users or just re-create them, then tick the box to import all attachments...
在新服务器上进行全新安装,并使用相同的方法进行导入,一旦 wordpress 下载并激活导入插件,只需上传您的 wordpress 文件,在导入过程中将用户分配给当前用户或重新创建它们,然后勾选该框以导入所有附件...
I've had this happen a few times when trying to move servers, some things in the database just get mixed up, but from previous experience, doing the export/import saved a lot of time..
我在尝试移动服务器时发生过几次这种情况,数据库中的某些内容只是混淆了,但是根据以前的经验,执行导出/导入节省了很多时间..
回答by Ben Maden
We had exactly the same issue but only on the Pages in the website.
我们遇到了完全相同的问题,但仅限于网站的页面上。
Steps to fix...
修复步骤...
Edit wp-config.php to add
define('WP_ALLOW_REPAIR', true);
Hit the database repair URL
HOSTNAME/wp-admin/maint/repair.php
编辑 wp-config.php 添加
define('WP_ALLOW_REPAIR', true);
打数据库修复网址
HOSTNAME/wp-admin/maint/repair.php
RESULT
结果
My database was a bit messed up and so I got the following output...
我的数据库有点乱,所以我得到了以下输出......
wp_usermeta: 5 clients are using or haven't closed the table properly
wp_posts: 7 clients are using or haven't closed the table properly
wp_options: 8 clients are using or haven't closed the table properly
wp_postmeta: 7 clients are using or haven't closed the table properly
wp_terms: 1 client is using or hasn't closed the table properly
wp_term_taxonomy: 3 clients are using or haven't closed the table properly
wp_term_relationships: 3 clients are using or haven't closed the table properly
回答by Travis
I had the same issue and it had to deal with the functions.php file. Make sure there are no mistakes there and try reuploading. You may also try using another theme to see if the problem persists.
我遇到了同样的问题,它必须处理 functions.php 文件。确保那里没有错误,然后尝试重新上传。您也可以尝试使用其他主题来查看问题是否仍然存在。
回答by johnny_n
It's the old standby, but deactivate your plugins one by one and see if the posts come back. It's such an odd problem that I couldn't imagine it was a plugin issue (posts disappearing in the admin?), but it was for me -- I discovered it after all sorts of database gymnastics, etc. My guess is the new server has a more recent version of php and that's what's causing the issue, but oddly it wasn't throwing a visible error (even in the logs).
这是旧的备用,但一个一个停用你的插件,看看帖子是否回来。这是一个奇怪的问题,我无法想象这是一个插件问题(帖子在管理员中消失了?),但它是给我的——我在各种数据库体操等之后发现了它。我猜是新服务器有更新版本的 php,这就是导致问题的原因,但奇怪的是它没有抛出可见错误(即使在日志中)。
回答by heni1022
In my case deactivating "WPML Media" plugin fixed the problem.
在我的情况下,停用“WPML Media”插件解决了这个问题。
回答by Surrogacy Georgia
In my case, I was using Poly Lang and was selected the Arabic language to show only and after switching to all problem solved.
就我而言,我使用的是 Poly Lang 并选择了阿拉伯语仅显示并在切换到所有问题解决后。
回答by joesmo
I had a similar issue and this is how I solved it: in the wp_posts table, I found out that the colums post_ENGINEand post_mime_ENGINEshould rather be post_typeand post_mime_type. I changed it and pages and posts are now showing in the admin panel. I don't know if my problem is the same but I hope it helps.
我有一个类似的问题,这就是我解决它的方法:在 wp_posts 表中,我发现列 post_ENGINE和post_mime_ENGINE应该是 post_type和post_mime_type。我更改了它,页面和帖子现在显示在管理面板中。我不知道我的问题是否相同,但我希望它有所帮助。
Instance where column names are post_ENGINE and post_mime_ENGINE
列名是 post_ENGINE 和 post_mime_ENGINE 的实例
Instance where column names are changed to post_type and post_mime_type
回答by Jeremy Quick
WordPress runs the following query to populate the post page in admin:
WordPress 运行以下查询来填充管理员中的帖子页面:
SELECT wp_posts.ID, wp_posts.post_parent FROM wp_posts
WHERE 1=1 AND wp_posts.post_type = 'article' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'virtual' OR wp_posts.post_status = 'future' OR wp_posts.post_status = 'draft' OR wp_posts.post_status = 'pending' OR wp_posts.post_status = 'private')
ORDER BY wp_posts.menu_order ASC, wp_posts.post_title ASC
I used this and found out during a data transfer that the post_status was set to 'published' instead of 'publish' which caused no articles to show despite showing a count.
我使用它并在数据传输过程中发现 post_status 设置为“已发布”而不是“已发布”,这导致尽管显示计数但没有显示文章。
回答by szk5
I had this same problem, I read Travis's comment and starting looking through my functions.php. Turns out query_posts() was causing the issue. To fix this, I added wp_reset_query();
after I was done retrieving data from my query.
我遇到了同样的问题,我阅读了 Travis 的评论并开始查看我的functions.php。结果是 query_posts() 导致了这个问题。为了解决这个问题,我wp_reset_query();
在完成从我的查询中检索数据后添加。