我知道这可能不受鼓励,但有没有办法用标准的图像横幅广告取代标准的仪表板小部件(最近的草稿、Quickpress等)?
我知道如何添加新的仪表板小部件,但我希望这是一个没有周围小部件的普通图像。
我知道这可能不受鼓励,但有没有办法用标准的图像横幅广告取代标准的仪表板小部件(最近的草稿、Quickpress等)?
我知道如何添加新的仪表板小部件,但我希望这是一个没有周围小部件的普通图像。
检查此参考
http://www.wpbeginner.com/wp-themes/how-to-add-custom-dashboard-widgets-in-wordpress/
用于添加仪表板小部件用于删除仪表板小部件add_action(\'wp_dashboard_setup\', \'example_remove_dashboard_widgets\' );
function example_remove_dashboard_widgets() {
remove_meta_box( \'dashboard_quick_press\', \'dashboard\', \'side\' );
remove_meta_box( \'dashboard_recent_drafts\', \'dashboard\', \'side\' );
remove_meta_box( \'dashboard_primary\', \'dashboard\', \'side\' );
remove_meta_box( \'dashboard_secondary\', \'dashboard\', \'side\' );
remove_meta_box( \'dashboard_browser_nag\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_right_now\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_recent_comments\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_incoming_links\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_plugins\', \'dashboard\', \'normal\' );
wp_add_dashboard_widget(\'custom_help_widget\', \'Theme Support\', \'custom_dashboard_help\');
}
function custom_dashboard_help() {
echo \'Your custom banner code\';
}
// Add & Remove meta boxes
function wpse50413_alter_dashboard_widgets()
{
// For details on removing widgets, see answer by @janw
remove_meta_box( \'dashboard_plugins\', \'dashboard\', \'normal\' );
// @link http://codex.wordpress.org/Function_Reference/add_meta_box
add_meta_box( \'dashboard_ad_widget\', \'Your Ad Title here\', \'wpse50413_add_adbox\', null, \'dashboard\' );
}
add_action( \'wp_dashboard_setup\', \'wpse50413_alter_dashboard_widgets\' );
// The callback function, that defines the ad
function wpse50413_add_adbox()
{
// display add here - this is the ad boxes contents
}
您需要知道的一切都在这里:
http://codex.wordpress.org/Dashboard_Widgets_API#Examples
删除函数中的所有标准仪表板小部件:
。php
<?php
add_action(\'wp_dashboard_setup\', \'example_remove_dashboard_widgets\' );
function example_remove_dashboard_widgets() {
remove_meta_box( \'dashboard_quick_press\', \'dashboard\', \'side\' );
remove_meta_box( \'dashboard_recent_drafts\', \'dashboard\', \'side\' );
remove_meta_box( \'dashboard_primary\', \'dashboard\', \'side\' );
remove_meta_box( \'dashboard_secondary\', \'dashboard\', \'side\' );
remove_meta_box( \'dashboard_browser_nag\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_right_now\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_recent_comments\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_incoming_links\', \'dashboard\', \'normal\' );
remove_meta_box( \'dashboard_plugins\', \'dashboard\', \'normal\' );
}
我在PHP版本5.2.17的WP 3.2.1安装中收到了这条消息Notice: Undefined index: filter in /home/netstewp/public_html/wp-includes/default-widgets.php on line 382 知道为什么吗?