无法在仪表板中看到所有页面(只能看到3)/wp-admin/edit.php>500错误

时间:2017-10-16 作者:Steve

一个客户的网站有12个页面,但我们都只能看到其中的3个页面,即使我们有管理员帐户,而创建一个新的管理员帐户并不能解决问题。

屏幕选项将不会打开,如果我检查Chrome控制台,我会看到:

加载资源失败:服务器响应状态为500():/wp admin/edit。php

我看得出来/wp-admin/edit.php 存在。

我已删除/wp-admin/wp-includes 并上传了新的副本。

我上传了一个新的父主题副本,而子主题未被触及。

如果我重命名pluginsplugins.temp 问题仍然存在。

感谢您的帮助。

EDIT1

如果打开调试并重新加载/wp-admin/edit.php?post_type=page, 我看到以下错误:

警告:在/home/user/public\\html/wp-content/themes/funtity/includes/admin/compat中,字符串偏移量“slideshow”非法。php在线48

致命错误:未捕获错误:无法在/home/user/public\\u html/wp-content/themes/funtity/includes/admin/compat中使用字符串偏移量作为数组。php:48堆栈跟踪:#0/home/user/public\\html/wp includes/class wp hook。php(298):avia\\u backend\\u compatibility\\u custom\\u field\\u filter(“”,127)\\1/主页/用户/公共\\u html/wp包含/插件。php(203):WP\\u Hook->apply\\u filters(“”,Array)#2/home/user/public\\html/WP content/themes/furnity/framework/php/function set avia frontend。php(262):apply\\u filters(\'avia\\u post\\u meta…\',\'\',127)#3/home/user/public\\u html/wp includes/class wp hook。php(300):avia\\u post\\u meta(Object(WP\\u post))#4/home/user/public\\u html/WP includes/class WP hook。php(323):WP\\u Hook->apply\\u filters(“”,Array)#5/home/user/public\\html/WP includes/plugin。php(515):WP\\u Hook->do\\u action(Array)#6/home/user/public\\u html/WP includes/class WP query。php(4070):do\\u action\\u ref\\u array(\'the\\u post\',array)#7/home/user/public\\u html/wp includes/query。php(938):WP\\u Query->setup\\u postdata(Object(WP\\u Post))\\8/home/mag-in/home/user/public\\html/WP-content/themes/furnity/includes/admin/compat。php在线48

EDIT2

这是第44至61行/abundance/includes/admin/compat.php

function avia_backend_compatibility_custom_field_filter($custom_fields, $post_id)
{
    if(empty($custom_fields))
    {
        $custom_fields[\'slideshow\'][0][\'slideshow_image\'] = "";
    }

    if(isset($custom_fields[\'slideshow\']) && is_array($custom_fields[\'slideshow\']) && isset($custom_fields[\'slideshow\'][0][\'slideshow_image\']))
    {
        $post_thumbnail_id = get_post_meta( $post_id, \'_thumbnail_id\', true );

        if($custom_fields[\'slideshow\'][0][\'slideshow_image\'] == "" && $post_thumbnail_id)
        {
            $custom_fields[\'slideshow\'][0][\'slideshow_image\'] = $post_thumbnail_id;
        }
    }
    return $custom_fields;
}

1 个回复
SO网友:Misha Rudrastyh

请打开您的wp配置。php文件并更改如下参数:

define(\'WP_DEBUG\', true);
激活此参数后,您可以查看有关错误的更多详细信息。

尝试激活任何默认的WordPress主题,如Twenty17,并查看错误是否仍然存在更新:

function avia_backend_compatibility_custom_field_filter($custom_fields, $post_id)
{
    if(empty($custom_fields))
    {
        $custom_fields = array(
             \'slideshow\' => array(
                 array( \'slideshow_image\' => \'\' )
             )
        );
    }

    if(isset($custom_fields[\'slideshow\']) && is_array($custom_fields[\'slideshow\']) && isset($custom_fields[\'slideshow\'][0][\'slideshow_image\']))
    {
        $post_thumbnail_id = get_post_meta( $post_id, \'_thumbnail_id\', true );

        if($custom_fields[\'slideshow\'][0][\'slideshow_image\'] == "" && $post_thumbnail_id)
        {
            $custom_fields[\'slideshow\'][0][\'slideshow_image\'] = $post_thumbnail_id;
        }
    }
    return $custom_fields;
}

结束

相关推荐