Although WordPress is often used as a full-fledged CMS, it isn’t nativly. Sure, it’s getting closer, but let’s face it — WordPress is still blog centric.
That being said, I really love WordPress and still use it as a basic CMS. Let’s just say, you’re not going to ever find Amazon running on WordPress.
Since WordPress isn’t built as a hardcore CMS out of the box, there are some modificaitons you can do that can mold it into more of one.
Here are five WordPress Administratoin modifcations you’re going to love.
All of these can be added to your themes functions.php or bundled in a functionality plugin.
Admin Warning
When your building a website for a client, they often want full administration. Even if you tell them all the reasons they really don’t want it, they feel as though they paid for it, so they should do whatever they want.
But what if they wreck the site? Who’s going to fix it? You are! Things can get really sticky at this point.
That’s why I love this snippet. By adding this, a warning appears (like those generated by plugins) when admin users are on Settings pages.
You can mod the text however you like:
[cc lang=”php”]add_action( ‘admin_notices’, ‘my_admin_notice’ );
function my_admin_notice(){
global $current_screen;
if ( $current_screen->parent_base == ‘options-general’ )
echo ‘
Warning – changing settings on these pages may cause problems with your website’s design!
‘;
}[/cc]
Now your client will be forewarned!
You could also add this to a church website that’s managed by multiple admins, just as a safety reminder.
Remove Links Menu
Okay, okay, okay, who still uses the Links menu?
I’ve had some nice uses for it in the past, but for the most part, it gets used less and less.
To help streamline your admin area and have one less menu option to confuse your client, you can easily remove it from the menu:
[cc lang=”php”]add_action( ‘admin_menu’, ‘my_admin_menu’ );
function my_admin_menu() {
remove_menu_page(‘link-manager.php’);
}[/cc]
Easy.
Change Posts Name
There are a number of reasons why you may want to consider changing ‘posts’ to something else. Perhaps your client would rather refer to them as ‘articles’ or you’re building a website that will never want to have a blog, but would like to display ‘announcements’ or ‘events.’ Simply changing the name could save you a lot of time creating custom post types and taxonomies!
It’s this easy:
[cc lang=”php”]// hook the translation filters
add_filter( ‘gettext’, ‘change_post_to_article’ );
add_filter( ‘ngettext’, ‘change_post_to_article’ );
function change_post_to_article( $translated ) {
$translated = str_ireplace( ‘Post’, ‘Article’, $translated ); // ireplace is PHP5 only
return $translated;
}[/cc]
😀
Change the Dashboard News Feeds
When’s the last time you read the WordPress Dashboard news feed? How about dropping in news your client would like?
[cc lang=”php”]add_action(‘wp_dashboard_setup’, ‘my_dashboard_widgets’);
function my_dashboard_widgets() {
global $wp_meta_boxes;
// remove unnecessary widgets
// var_dump( $wp_meta_boxes[‘dashboard’] ); // use to get all the widget IDs
unset(
$wp_meta_boxes[‘dashboard’][‘normal’][‘core’][‘dashboard_plugins’],
$wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_secondary’],
$wp_meta_boxes[‘dashboard’][‘side’][‘core’][‘dashboard_primary’]
);
// add a custom dashboard widget
wp_add_dashboard_widget( ‘dashboard_custom_feed’, ‘News from ChurchMag’, ‘dashboard_custom_feed_output’ ); //add new RSS feed output
}
function dashboard_custom_feed_output() {
echo ‘
“;
}[/cc]
And your done!
Add Credits to Admin Footer
Sure, it’s vain.
Here’s how you can add your own credits to the Admin side:
[cc lang=”php”]add_filter( ‘admin_footer_text’, ‘my_admin_footer_text’ );
function my_admin_footer_text( $default_text ) {
return ‘
You’ll find your new credit right next to the “Powered by WordPress” in the Admin footer.
[via Smashing Magazine]
April says
I’m trying to add this to a client site. I am currently using Standard Theme. I went direclty into the site through the web and added it to the function.php (which comes up under the admin folder in FTP) but when I added it, it killed the site. I went back in through the cpanel and was able to fix it but am afraid to try again. Do I add this to the functions.php that comes up directly under the Standard Theme folder and not the one under the StandardTheme/admin folder?
April says
Never mind, figured it out! 🙂
April says
I think it’s a great idea to build in custom functions when you don’t want the client to mess up something in the admin section!
Eric Dye says
Indeed!
Phil Schneider says
These are awesome! I’m going to have to invent a reason to use them.
Eric Dye says
LOL!
Eric J says
The warn on settings page doesn’t work for me
arse error: syntax error, unexpected '<'
Ross W says
Yup…there’s an erroneous in the first bit of code.
What would be really cool would be to wrap these snippets up in a plugin with options so people can use them more easily. Or in a file that people can just include in their functions.php.
Eric J says
//add warning on admin pages
add_action( 'admin_notices', 'my_admin_notice' );
function my_admin_notice(){
global $current_screen;
if ( $current_screen->parent_base == 'options-general' )
echo '
Warning - changing settings on these pages may cause problems with your website’s design!
';
}
Ok thanks for that tip i customized it and got it working.
Eric J says
anyone know how to add it on the appearance, plugins, and user pages as well?
Eric Dye says
Awesome!
Ross W says
Oops, my code got removed. It’s an erroneous div.