Blank Dashboard
wordpress安装以后,经常发生Dashboard页空白,进入wordpress后台慢。原因是因为进入后台时会默认加载一些wordpress的新闻RSS。
其中就是把进入后台是要加载的wordpress的新闻注释掉,编辑/wp-admin/index.php,删除line17-line32.。
但有人提出,有时候需要看看新闻,可以即时更新之类的。可在后台的菜单中直接添加了一个“news”项,需要的时候可以去看看,又不影响进入后台速度。
需修改了wp-admin文件夹中的index.php和menu.php两个文件,添加了一个news.php文件。
使用方法:下载我修改后的文件,上传到你服务器的wp-admin文件夹中替换掉原来的index.php和menu.php两个文件即可,同时把news.php文件也复制进去。替换前请把原来的文件备份(虽说没什么必要,但安全第一嘛)。
index.php
注释掉
- $rss = @fetch_rss
即可。共有三处。
menu.php
在
- $menu[45] = array(__('Import'), 'import', 'import.php');
后添加
- $menu[50] = array(__('News'), 'import', 'news.php');
news.php
- < ?php
- require_once('admin.php');
- $title = __('News');
- $parent_file = 'news.php';
- require_once('admin-header.php');
- require_once (ABSPATH . WPINC . '/rss-functions.php');
- $today = current_time('mysql', 1);
- ?>
- <div class="wrap">
- <h2>< ?php _e('News'); ?></h2>
- < ?php
- $rss = @fetch_rss('http://feeds.technorati.com/cosmos/rss/?url='. trailingslashit(get_option('home')) .'&partner=wordpress');
- if ( isset($rss->items) && 0 != count($rss->items) ) {
- ?>
- < ?php } ?>
- <h3>< ?php _e('Welcome to WordPress'); ?></h3>
- <p>< ?php _e("Below is the latest news from the official WordPress development blog, click on a title to read the full entry. If you need help with WordPress please see our <a href='http://codex.wordpress.org/'>great documentation or if that doesn't help visit the <a href='http://wordpress.org/support/'>support forums</a>."); ?></p>
- < ?php
- $rss = @fetch_rss('http://wordpress.org/development/feed/');
- if ( isset($rss->items) && 0 != count($rss->items) ) {
- ?>
- <h3>< ?php _e('WordPress Development Blog'); ?></h3>
- < ?php
- $rss->items = array_slice($rss->items, 0, 3);
- foreach ($rss->items as $item ) {
- ?>
- <h4><a href='<?php echo wp_filter_kses($item['link']); ?>'>< ?php echo wp_specialchars($item['title']); ?></a> — < ?php printf(__('%s ago'), human_time_diff(strtotime($item['pubdate'], time() ) ) ); ?></h4>
- <p>< ?php echo $item['description']; ?></p>
- < ?php
- }
- }
- ?>
- < ?php
- $rss = @fetch_rss('http://planet.wordpress.org/feed/');
- if ( isset($rss->items) && 0 != count($rss->items) ) {
- ?>
- <div id="planetnews">
- <h3>< ?php _e('Other WordPress News'); ?> <a href="http://planet.wordpress.org/">< ?php _e('more'); ?> »</a></h3>
- <ul>
- < ?php
- $rss->items = array_slice($rss->items, 0, 20);
- foreach ($rss->items as $item ) {
- ?>
- <li><a href='<?php echo wp_filter_kses($item['link']); ?>'>< ?php echo wp_specialchars($item['title']); ?></a></li>
- < ?php
- }
- ?>
- </ul>
- </div>
- < ?php
- }
- ?>
- <div style="clear: both">
- <br clear="all" />
- </div>
- </div>
- < ?php
- require('./admin-footer.php');
- ?>











[...] 1、使WordPress支持RAR文件上传 2、加快进入Dashboard的速度 3、QuickTag支持coolcode wp-includes/js/quicktags.js 注释掉118到124行,在下面添加如下代码 edButtons[edButtons.length] = [...]
[...] (此文我先把记录下来,在我的电脑上登录后台时一点也不慢,所以测试不出来。网址:http://www.gythialy.net/posts/48#more-48) [...]
[...] 感觉还是不够快,那些新闻我从来都不看,对我来说就是额外的消耗。所以决定干掉它们发现原来的方法已经不可以了。看下源码,现在只要注释掉index-extra.php中的$rss = @fetch_rss就可以了,共有三处。或者直接删掉index.php中的6-13行。 <script type=”text/javascript”> Event.observe( window, ‘load’, dashboard_init, false ); function dashboard_init() { var update1 = new Ajax.Updater( ‘incominglinks’, ‘index-extra.php?jax=incominglinks’ ); var update2 = new Ajax.Updater( ‘devnews’, ‘index-extra.php?jax=devnews’ ); var update3 = new Ajax.Updater( ‘planetnews’, ‘index-extra.php?jax=planetnews’ ); } </script> [...]