Replace dashboard widgets with banner ad

I know it’s probably not encouraged, but is there a way to replace the standard dashboard widgets (Recent Drafts, Quickpress, etc.) with a standard image banner ad?

I know how to add new dashboard widgets, but I want this to be a plain image with no surrounding widget.

3 Answers
3

Check this reference

http://www.wpbeginner.com/wp-themes/how-to-add-custom-dashboard-widgets-in-wordpress/

for adding dashboard widget

Remove Widgets in Dashboard

for removing dashboard widget

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';
    }

Leave a Comment