Some of my clients are using their WordPress installs with pages only, i.e. without any posts, and with comments turned off completely. This is often referred to as “WordPress as a CMS”. To free the screen from clutter I like to remove the comments link from the new/revised WordPress 3.3 Admin Bar. I also usually change the “+ New” link to default to creating a new page instead of creating a new post.
To accomplish this you can drop the following lines into your theme’s functions.php
file:
<?php function my_admin_bar_menu( $wp_admin_bar ) { $wp_admin_bar->remove_node( 'comments' ); $newpage = $wp_admin_bar->get_node( 'new-page' ); $wp_admin_bar->add_node( array( 'id' => 'new-content', 'href' => $newpage->href, ) ); } add_action( 'admin_bar_menu', 'my_admin_bar_menu', 100 );
To find out more about the Admin Bar API you should check out this post by Andrew Nacin on the official WordPress Development Blog.
Recent Comments