php 什么会导致 WordPress 管理屏幕空白,除了导航栏?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21614237/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 04:17:25  来源:igfitidea点击:

What would cause WordPress admin screen to be blank, except for nav bar?

phpwordpress

提问by Lee Fuller

So I've read through all the similar questions and can't find a solution here. Basically the user-facing site looks fine and is functioning properly. The WP Admin, however, shows only the left navigation menu... and nothing more.

所以我已经阅读了所有类似的问题,但在这里找不到解决方案。基本上,面向用户的站点看起来不错并且运行正常。但是,WP Admin 仅显示左侧导航菜单……仅此而已。

I've tried all the basic solutions -- removing themes, removing plugins, turning on error reporting, and all that I get is a few typical warnings.

我已经尝试了所有基本的解决方案——删除主题、删除插件、打开错误报告,我得到的只是一些典型的警告。

The admin was working fine a week or two ago - and I haven't been in it since. Also, it's a couple of versions old - but he original designer of this site warned NOT to upgrade WordPress or it would break the code.

管理员在一两个星期前工作得很好 - 从那以后我就没有参加过。此外,它有几个旧版本 - 但他本网站的原始设计师警告不要升级 WordPress 否则会破坏代码。

So I thought I'd post the page source here to see if anyone may have a suggestion as to where to look from here. NOTE, this is the WPADMIN page source, not the the source from the website.

所以我想我会在这里发布页面源代码,看看是否有人可能对从这里查看的位置提出建议。注意,这是 WPADMIN 页面源,而不是来自网站的源。

Here's a screenshot of what I'm seeing.Screen Shot Here

这是我所看到的截图。屏幕截图在这里

Here is what I get when I login to the WP ADMIN:

这是我登录 WP ADMIN 时得到的信息:

<!DOCTYPE html>
<!--[if IE 8]>
<html xmlns="http://www.w3.org/1999/xhtml" class="ie8"  dir="ltr" lang="en-US">
<![endif]-->
<!--[if !(IE 8) ]><!-->
<html xmlns="http://www.w3.org/1999/xhtml"  dir="ltr" lang="en-US">
<!--<![endif]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Dashboard &lsaquo; Suncoast Surgical Associates | Tampa and Brandon, Florida General Surgery and Laparoscopic Surgery &#8212; WordPress</title>
<script type="text/javascript">
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
var userSettings = {
        'url': '/',
        'uid': '3',
        'time':'1391720939'
    },
    ajaxurl = 'http://suncoastsurgicalassociates.com/wp-admin/admin-ajax.php',
    pagenow = 'dashboard',
    typenow = '',
    adminpage = 'index-php',
    thousandsSeparator = ',',
    decimalPoint = '.',
    isRtl = 0;
</script>
<link rel='stylesheet' href='http://suncoastsurgicalassociates.com/wp-admin/load-styles.php?c=1&amp;dir=ltr&amp;load=admin-bar,wp-admin&amp;ver=7f0753feec257518ac1fec83d5bced6a' type='text/css' media='all' />
<link rel='stylesheet' id='thickbox-css'  href='http://suncoastsurgicalassociates.com/wp-includes/js/thickbox/thickbox.css?ver=20111117' type='text/css' media='all' />
<link rel='stylesheet' id='colors-css'  href='http://suncoastsurgicalassociates.com/wp-admin/css/colors-fresh.css?ver=20111206' type='text/css' media='all' />
<!--[if lte IE 7]>
<link rel='stylesheet' id='ie-css'  href='http://suncoastsurgicalassociates.com/wp-admin/css/ie.css?ver=20111130' type='text/css' media='all' />
<![endif]-->
<link rel='stylesheet' id='akismet.css-css'  href='http://suncoastsurgicalassociates.com/wp-content/plugins/akismet/akismet.css?ver=2.5.4.4' type='text/css' media='all' />
<link rel='stylesheet' id='jcrop_style-css'  href='http://suncoastsurgicalassociates.com/wp-content/plugins/scissors-continued/css/jquery.Jcrop.css?ver=3.3.1' type='text/css' media='all' />
<link rel='stylesheet' id='scissors_style-css'  href='http://suncoastsurgicalassociates.com/wp-content/plugins/scissors-continued/css/scissors.css?ver=3.3.1' type='text/css' media='all' />
<script type='text/javascript'>
/* <![CDATA[ */
var WPAkismet = {"comment_author_url_nonce":"3190b6c9aa"};
/* ]]> */
</script>
<script type='text/javascript' src='http://suncoastsurgicalassociates.com/wp-admin/load-scripts.php?c=1&amp;load=jquery,utils&amp;ver=edec3fab0cb6297ea474806db1895fa7'></script>
<script type='text/javascript' src='http://suncoastsurgicalassociates.com/wp-content/plugins/akismet/akismet.js?ver=2.5.4.6'></script>
    <style type="text/css">
    #adminmenu .toplevel_page_formidable div.wp-menu-image{background: url(http://suncoastsurgicalassociates.com/wp-content/plugins/formidable/images/form_16.png) no-repeat center;}
    </style>    
    <style type="text/css" media="print">#wpadminbar { display:none; }</style>
</head>
<body class="wp-admin no-js  index-php admin-bar branch-3-3 version-3-3-1 admin-color-fresh">
<script type="text/javascript">document.body.className = document.body.className.replace('no-js','js');</script>

<div id="wpwrap">

<div id="adminmenuback"></div>
<div id="adminmenuwrap">
<div id="adminmenushadow"></div>
<ul id="adminmenu" role="navigation">


    <li class="wp-first-item wp-has-submenu wp-has-current-submenu wp-menu-open menu-top menu-top-first menu-icon-dashboard menu-top-last" id="menu-dashboard">
    <div class='wp-menu-image'><a href='index.php'><br /></a></div><div class="wp-menu-arrow"><div></div></div><a href='index.php' class="wp-first-item wp-has-submenu wp-has-current-submenu wp-menu-open menu-top menu-top-first menu-icon-dashboard menu-top-last" tabindex="1">Dashboard</a>
    <div class='wp-submenu'><div class='wp-submenu-wrap'><div class='wp-submenu-head'>Dashboard</div><ul><li class="wp-first-item current"><a href='index.php' class="wp-first-item current" tabindex="1">Home</a></li><li><a href='update-core.php' tabindex="1">Updates <span class='update-plugins count-3' title='1 WordPress Update, 2 Theme Updates'><span class='update-count'>3</span></span></a></li><li><a href='index.php?page=akismet-stats-display' tabindex="1">Akismet Stats</a></li></ul></div></div></li>
    <li class="wp-not-current-submenu wp-menu-separator"><div class="separator"></div></li>
    <li class="wp-has-submenu wp-not-current-submenu open-if-no-js menu-top menu-icon-post menu-top-first" id="menu-posts">
    <div class='wp-menu-image'><a href='edit.php'><br /></a></div><div class="wp-menu-arrow"><div></div></div><a href='edit.php' class="wp-has-submenu wp-not-current-submenu open-if-no-js menu-top menu-icon-post menu-top-first" tabindex="1" aria-haspopup="true">Posts</a>
    <div class='wp-submenu'><div class='wp-submenu-wrap'><div class='wp-submenu-head'>Posts</div><ul><li class="wp-first-item"><a href='edit.php' class="wp-first-item" tabindex="1">All Posts</a></li><li><a href='post-new.php' tabindex="1">Add New</a></li><li><a href='edit-tags.php?taxonomy=category' tabindex="1">Categories</a></li><li><a href='edit-tags.php?taxonomy=post_tag' tabindex="1">Tags</a></li></ul></div></div></li>
    <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-media" id="menu-media">
    <div class='wp-menu-image'><a href='upload.php'><br /></a></div><div class="wp-menu-arrow"><div></div></div><a href='upload.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-media" tabindex="1" aria-haspopup="true">Media</a>
    <div class='wp-submenu'><div class='wp-submenu-wrap'><div class='wp-submenu-head'>Media</div><ul><li class="wp-first-item"><a href='upload.php' class="wp-first-item" tabindex="1">Library</a></li><li><a href='media-new.php' tabindex="1">Add New</a></li></ul></div></div></li>
    <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-links" id="menu-links">
    <div class='wp-menu-image'><a href='link-manager.php'><br /></a></div><div class="wp-menu-arrow"><div></div></div><a href='link-manager.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-links" tabindex="1" aria-haspopup="true">Links</a>
    <div class='wp-submenu'><div class='wp-submenu-wrap'><div class='wp-submenu-head'>Links</div><ul><li class="wp-first-item"><a href='link-manager.php' class="wp-first-item" tabindex="1">All Links</a></li><li><a href='link-add.php' tabindex="1">Add New</a></li><li><a href='edit-tags.php?taxonomy=link_category' tabindex="1">Link Categories</a></li></ul></div></div></li>
    <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-page" id="menu-pages">
    <div class='wp-menu-image'><a href='edit.php?post_type=page'><br /></a></div><div class="wp-menu-arrow"><div></div></div><a href='edit.php?post_type=page' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-page" tabindex="1" aria-haspopup="true">Pages</a>
    <div class='wp-submenu'><div class='wp-submenu-wrap'><div class='wp-submenu-head'>Pages</div><ul><li class="wp-first-item"><a href='edit.php?post_type=page' class="wp-first-item" tabindex="1">All Pages</a></li><li><a href='post-new.php?post_type=page' tabindex="1">Add New</a></li></ul></div></div></li>
    <li class="wp-not-current-submenu menu-top menu-icon-comments menu-top-last" id="menu-comments">
    <div class='wp-menu-image'><a href='edit-comments.php'><br /></a></div><div class="wp-menu-arrow"><div></div></div><a href='edit-comments.php' class="wp-not-current-submenu menu-top menu-icon-comments menu-top-last" tabindex="1">Comments <span class='awaiting-mod count-1'><span class='pending-count'>1</span></span></a></li>
    <li class="wp-not-current-submenu wp-menu-separator"><div class="separator"></div></li>
    <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-appearance menu-top-first" id="menu-appearance">
    <div class='wp-menu-image'><a href='themes.php'><br /></a></div><div class="wp-menu-arrow"><div></div></div><a href='themes.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-appearance menu-top-first" tabindex="1" aria-haspopup="true">Appearance</a>
    <div class='wp-submenu'><div class='wp-submenu-wrap'><div class='wp-submenu-head'>Appearance</div><ul><li class="wp-first-item"><a href='themes.php' class="wp-first-item" tabindex="1">Themes</a></li><li><a href='widgets.php' tabindex="1">Widgets</a></li><li><a href='theme-editor.php' tabindex="1">Editor</a></li></ul></div></div></li>
    <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-plugins" id="menu-plugins">
    <div class='wp-menu-image'><a href='plugin-install.php'><br /></a></div><div class="wp-menu-arrow"><div></div></div><a href='plugin-install.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-plugins" tabindex="1" aria-haspopup="true">Plugins </a>
    <div class='wp-submenu'><div class='wp-submenu-wrap'><div class='wp-submenu-head'>Plugins </div><ul><li class="wp-first-item"><a href='plugin-install.php' class="wp-first-item" tabindex="1">Add New</a></li><li><a href='plugin-install.php?page=akismet-key-config' tabindex="1">Akismet Configuration</a></li></ul></div></div></li>
    <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-users" id="menu-users">
    <div class='wp-menu-image'><a href='profile.php'><br /></a></div><div class="wp-menu-arrow"><div></div></div><a href='profile.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-users" tabindex="1" aria-haspopup="true">Profile</a>
    <div class='wp-submenu'><div class='wp-submenu-wrap'><div class='wp-submenu-head'>Profile</div><ul><li class="wp-first-item"><a href='profile.php' class="wp-first-item" tabindex="1">Your Profile</a></li><li><a href='user-new.php' tabindex="1">Add New User</a></li></ul></div></div></li>
    <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-tools" id="menu-tools">
    <div class='wp-menu-image'><a href='tools.php'><br /></a></div><div class="wp-menu-arrow"><div></div></div><a href='tools.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-tools" tabindex="1" aria-haspopup="true">Tools</a>
    <div class='wp-submenu'><div class='wp-submenu-wrap'><div class='wp-submenu-head'>Tools</div><ul><li class="wp-first-item"><a href='tools.php' class="wp-first-item" tabindex="1">Available Tools</a></li><li><a href='import.php' tabindex="1">Import</a></li><li><a href='export.php' tabindex="1">Export</a></li></ul></div></div></li>
    <li class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings menu-top-last" id="menu-settings">
    <div class='wp-menu-image'><a href='options-general.php'><br /></a></div><div class="wp-menu-arrow"><div></div></div><a href='options-general.php' class="wp-has-submenu wp-not-current-submenu menu-top menu-icon-settings menu-top-last" tabindex="1" aria-haspopup="true">Settings</a>
    <div class='wp-submenu'><div class='wp-submenu-wrap'><div class='wp-submenu-head'>Settings</div><ul><li class="wp-first-item"><a href='options-general.php' class="wp-first-item" tabindex="1">General</a></li><li><a href='options-writing.php' tabindex="1">Writing</a></li><li><a href='options-reading.php' tabindex="1">Reading</a></li><li><a href='options-discussion.php' tabindex="1">Discussion</a></li><li><a href='options-media.php' tabindex="1">Media</a></li><li><a href='options-privacy.php' tabindex="1">Privacy</a></li><li><a href='options-permalink.php' tabindex="1">Permalinks</a></li><li><a href='options-general.php?page=fancybox-for-wordpress' tabindex="1">Fancybox for WP</a></li><li><a href='options-general.php?page=mappress' tabindex="1">MapPress</a></li></ul></div></div></li><li id="collapse-menu" class="hide-if-no-js"><div id="collapse-button"><div></div></div><span>Collapse menu</span></li></ul>
</div>
<div id="wpcontent">


<div id="wpbody">

<div id="wpbody-content">
        <div id="screen-meta" class="metabox-prefs">

            <div id="contextual-help-wrap" class="hidden">
                <div id="contextual-help-back"></div>
                <div id="contextual-help-columns">
                    <div class="contextual-help-tabs">
                        <ul>

                            <li id="tab-link-overview" class="active">
                                <a href="#tab-panel-overview">
                                    Overview                                </a>
                            </li>

                            <li id="tab-link-help-navigation" class="">
                                <a href="#tab-panel-help-navigation">
                                    Navigation                              </a>
                            </li>

                            <li id="tab-link-help-layout" class="">
                                <a href="#tab-panel-help-layout">
                                    Layout                              </a>
                            </li>

                            <li id="tab-link-help-content" class="">
                                <a href="#tab-panel-help-content">
                                    Content                             </a>
                            </li>
                                                </ul>
                    </div>

                                        <div class="contextual-help-sidebar">

I noticed that the help sidebar is where it ends. Yet that doesn't give me anywhere specific to look.

我注意到帮助侧边栏是它结束的地方。然而,这并没有给我任何具体的地方。

Any help would be appreciated.

任何帮助,将不胜感激。

Thanks...

谢谢...

回答by Lee Fuller

Ok.. found it.

好的。。找到了。

This was the offending code, and it was in wp-admin\includes\screen.phpon line 706:

这是有问题的代码,它在wp-admin\includes\screen.php第 706 行:

<?php echo self::$this->_help_sidebar; ?>

It should be:

它应该是:

<?php echo $this->_help_sidebar; ?>

Have no idea why this suddenly decided to go bad. And frankly I'm not sure I'll ever find out.

不知道为什么这突然决定变坏。坦率地说,我不确定我是否会发现。

But wanted to help others if possible.

但如果可能的话,想帮助别人。

Take care everyone.. and thanks...

大家多多关照。。。谢谢。。。

回答by user3682672

FYI, I had the exact same problem, and this solution worked for me. ie: change:

仅供参考,我遇到了完全相同的问题,这个解决方案对我有用。即:改变:

echo self::$this->_help_sidebar;

to

echo $this->_help_sidebar;

回答by Lem

Indeed this worked for me too, changing to

确实这对我也有用,改为

<?php echo $this->_help_sidebar; ?>

I believe it is a matter of the php version we use

我相信这是我们使用的php版本的问题

Check here to understantd self:: functionality :

在这里检查以了解 self:: 功能:

http://www.diffen.com/difference/self_(PHP)_vs_this_(PHP)

http://www.diffen.com/difference/self_(PHP)_vs_this_(PHP)