Harold Mansfield
03-09-2012, 08:19 PM
Of course there are a ton of cool things that you can do with WordPress. I still learn something new almost everyday and I've been building with and hacking WordPress for over 5 years.
One of my favorites is adding your contact info and blog's rss feed to a client's dashboard. In all my years, I have never seen a client change thier dashboard from the way I set it up for them when I built the site.
You just need to create a custom widget by adding a little code to the theme's functions.php file. This is actually for BOTH widgets.
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;
wp_add_dashboard_widget('custom_help_widget', 'For Help and Support', 'custom_dashboard_help');
}
function custom_dashboard_help() {
echo '
<h4>For Wordpress Website Service and Consulting, <br>
<a href="mailto:harold@1stinternetmedia.com">Contact Harold</a> at <a href="https://haroldmansfield.com/support"target="new">1st Internet Media Support</a> | 707-706-3342</h4><br>
<h4>For Branding, Web Marketing and Social Media Strategies<br>
<a href="mailto:ann@annmanion.com"> Contact Ann Manion</a> | <a href="http://annmanion.com"target="new">AnnManion.com</a> | 617-531-1672</h4>
';
}
// Hook into wp_dashboard_setup and add our widget
add_action('wp_dashboard_setup', 'shaken_rss_widget');
// Create the function that adds the widget
function shaken_rss_widget(){
// Add our RSS widget
wp_add_dashboard_widget( 'shaken-rss', 'WordPress and Web Tips', 'shaken_rss_output');
}
function shaken_rss_output(){
echo '<div class="rss-widget">';
wp_widget_rss_output(array(
'url' => 'https://1stinternetmedia.com/feed', //put your feed URL here
'title' => 'Latest News from 1st Internet Media', // Your feed title
'items' => 4, //how many posts to show
'show_summary' => 1, // 0 = false and 1 = true
'show_author' => 0,
'show_date' => 1
));
echo "</div>";
}
That's it! I've highlighted the variables where you input your widget title, information, and set how many posts to display. Obviously you will replace your information where mine is.
Here's a screenshot from a client's dashboard:
194
Here's an article that explains it in detail:
How to Add Custom Dashboard Widgets in WordPress (http://www.wpbeginner.com/wp-themes/how-to-add-custom-dashboard-widgets-in-wordpress/)
And the WordPress codex on it:
Function Reference/wp add dashboard widget « WordPress Codex (http://codex.wordpress.org/Function_Reference/wp_add_dashboard_widget)
One of my favorites is adding your contact info and blog's rss feed to a client's dashboard. In all my years, I have never seen a client change thier dashboard from the way I set it up for them when I built the site.
You just need to create a custom widget by adding a little code to the theme's functions.php file. This is actually for BOTH widgets.
add_action('wp_dashboard_setup', 'my_custom_dashboard_widgets');
function my_custom_dashboard_widgets() {
global $wp_meta_boxes;
wp_add_dashboard_widget('custom_help_widget', 'For Help and Support', 'custom_dashboard_help');
}
function custom_dashboard_help() {
echo '
<h4>For Wordpress Website Service and Consulting, <br>
<a href="mailto:harold@1stinternetmedia.com">Contact Harold</a> at <a href="https://haroldmansfield.com/support"target="new">1st Internet Media Support</a> | 707-706-3342</h4><br>
<h4>For Branding, Web Marketing and Social Media Strategies<br>
<a href="mailto:ann@annmanion.com"> Contact Ann Manion</a> | <a href="http://annmanion.com"target="new">AnnManion.com</a> | 617-531-1672</h4>
';
}
// Hook into wp_dashboard_setup and add our widget
add_action('wp_dashboard_setup', 'shaken_rss_widget');
// Create the function that adds the widget
function shaken_rss_widget(){
// Add our RSS widget
wp_add_dashboard_widget( 'shaken-rss', 'WordPress and Web Tips', 'shaken_rss_output');
}
function shaken_rss_output(){
echo '<div class="rss-widget">';
wp_widget_rss_output(array(
'url' => 'https://1stinternetmedia.com/feed', //put your feed URL here
'title' => 'Latest News from 1st Internet Media', // Your feed title
'items' => 4, //how many posts to show
'show_summary' => 1, // 0 = false and 1 = true
'show_author' => 0,
'show_date' => 1
));
echo "</div>";
}
That's it! I've highlighted the variables where you input your widget title, information, and set how many posts to display. Obviously you will replace your information where mine is.
Here's a screenshot from a client's dashboard:
194
Here's an article that explains it in detail:
How to Add Custom Dashboard Widgets in WordPress (http://www.wpbeginner.com/wp-themes/how-to-add-custom-dashboard-widgets-in-wordpress/)
And the WordPress codex on it:
Function Reference/wp add dashboard widget « WordPress Codex (http://codex.wordpress.org/Function_Reference/wp_add_dashboard_widget)