Is there a way to add a banner to the WP dashboard? I don’t mean in a custom widget or anything, just a simple image banner.

Answer

Workaround using jQuery DOM insertion.
Note the use of PHP Heredoc sintax to print the script.

This inserts the new div at the top before #welcome-panel. If you use the div #dashboard-widgets-wrap it prints in the same position (after

Dashboard

and before the widgets).
The welcome panel is normally hidden, but I’m not sure of its general behavior. I guess this depends on your tests.

[edit]
As a matter of fact, just inspect the page and insert wherever you want.

[edit 2]
Playing with the code…
The following version does a fade-in of the widgets wrap. It also adds the width and height in the image tag, so other elements don’t “jump” when the image finally loads.

Share →

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>