Page 1 of 1
WordPress Dashboard Widgets
#1
Posted 16 January 2012 - 01:27 PM
Is there any way to change the order of the default dashboard widgets using the functions.php file? I can easily add a custom widget but cannot seem to change the order of the default widgets...
#2
Posted 16 January 2012 - 01:44 PM
AFAIK not using a simple hook, no. All I can think of, and it's very bloated and messy, is to de-register the default widgets, then add them in manually but in the order you want. But as I say that's very bloated.
Not sure of any other way though.
Not sure of any other way though.
#3
Posted 17 January 2012 - 02:07 PM
brightonmike, on 16 January 2012 - 01:44 PM, said:
AFAIK not using a simple hook, no. All I can think of, and it's very bloated and messy, is to de-register the default widgets, then add them in manually but in the order you want. But as I say that's very bloated.
Not sure of any other way though.
Not sure of any other way though.
Thanks Mike, yeah I did try that, didn't seem to work though
It doesn't matter too much, was just an idea to try and reorder some of the widgets a bit...
#4
Posted 17 January 2012 - 02:15 PM
You can just click and drag their title bars to re-order them. Plus, if you hit the "Screen Options" button in the top right you can remove one you don't want.
Or are you looking to do it permanently for new WP installations?
Or are you looking to do it permanently for new WP installations?
This post has been edited by Spitfire: 17 January 2012 - 02:16 PM
#5
Posted 17 January 2012 - 02:19 PM
Spitfire, on 17 January 2012 - 02:15 PM, said:
You can just click and drag their title bars to re-order them. Plus, if you hit the "Screen Options" button in the top right you can remove one you don't want.
Or are you looking to do it permanently for new WP installations?
Or are you looking to do it permanently for new WP installations?
Yeah, more perminently. Currently creating a custom wordpress boilerplate/installation for use on future projects and just wanted to reorder a few things so it flows better.
Adding new widgets is easy, seems moving the default ones is annoyingly awkward! lol
#6
Posted 17 January 2012 - 03:23 PM
The order of the widgets is stored in an array so you should just be able to shuffle them about into the order you want, for example:
You can get the full list of what the various default widgets are called here:
http://codex.wordpre...shboard_Widgets
However, doing that will probably mean that you won't be able to drag and drop the widgets to re-order them any more.
add_action('wp_dashboard_setup', 'every_day_im_shuffling');
function every_day_im_shuffling() {
global $wp_meta_boxes;
$wp_meta_boxes['dashboard']['normal']['core'] = array(
$wp_meta_boxes['dashboard']['normal']['high']['dashboard_browser_nag'],
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'],
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'],
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'],
$wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']
);
}You can get the full list of what the various default widgets are called here:
http://codex.wordpre...shboard_Widgets
However, doing that will probably mean that you won't be able to drag and drop the widgets to re-order them any more.
This post has been edited by Spitfire: 17 January 2012 - 03:23 PM
- ← Error while accessing to Template Manager in joomla 1.5
- Content Management Systems (CMS)
- Wordpress base URL →
Share this topic:
Page 1 of 1
Help



















