Keeping It Simple
      (but not stupid)



   Stephanie Leary, @sleary
        sillybean.net
Dashboard & Menus
Unclutter: Adminimize
Dashboard Commander
Prefer Code?
function remove_dashboard_widgets() {
    global $wp_meta_boxes;
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
// unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
// unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
// unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_drafts']);
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
    unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
    // WordPress Blog
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
    // Other WordPress News
    unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
}
add_action('wp_dashboard_setup', 'remove_dashboard_widgets' );



                  http://gist.github.com/2722692
CMS Dashboard
Full Comments On
    Dashboard
Dashboard Notepad
Widgets




http://core.trac.wordpress.org/ticket/18334
Widgets




http://core.trac.wordpress.org/ticket/18334
Organizing
Hierarchy
Simple Page Ordering
List Child Pages
// list child pages automatically on empty pages
function append_child_pages($content) {
   $children = '';
   if (is_page() && (empty($content))) {
      global $post;
      $children = '
<ul
class="childpages">'.wp_list_pages('echo=0&title_li=&child_of='.
$post->ID).'</ul>
';
   }
   return $content.$children;
}
add_filter('the_content','append_child_pages');
List Child Pages

// child page list shortcode: [children]
function child_pages_shortcode() {
   global $post;
   return '<ul class="childpages">'.
" " wp_list_pages('echo=0&depth=0&title_li=&child_of='.
" " $post->ID).'</ul>';
}
add_shortcode('children', 'child_pages_shortcode');
Writing
Shortcode Reference
Gallery Metabox
Post Container Warning
Post Container Warning
// Admin Notice on Posts Page
add_action('admin_head-post.php', 'postspage_error_notice');

function postspage_error_notice() {
    $postspage = get_option('page_for_posts');
    if (!empty($postspage))
        add_action('admin_notices', 'postspage_print_notices');
}

function postspage_print_notices() {
    $postspage = get_option('page_for_posts');

    // show this only if we're editing the posts page
    if (!empty($postspage) && isset($_GET['action']) &&
$_GET['action'] == 'edit' && $_GET['post'] == $postspage)
        echo '<div class="error"><p>This page is a container for
the most recent posts. It should always be empty, and you should
never edit this page. To add a news item, go to <a href="post-
new.php">Posts -- Add New</a>.<p></div>';
}

       http://gist.github.com/2515588
Removing Meta Boxes

add_action( 'add_meta_boxes', 'my_remove_post_meta_boxes' );


function my_remove_post_meta_boxes() {


"   /* Custom fields meta box. */
"   remove_meta_box( 'postcustom', 'post', 'normal' );
}




          justintadlock.com/?p=2898
Raw HTML Snippets
Notifications
Peter’s Collaboration
       Emails
Notifly
Collateral Condolences
For Visitors
Better 404s


• apologetic, personal language
• search for words in the bad URL
• show search box and sitemap


     http://gist.github.com/2723096
404.php (1)
"   <h2>I'm sorry. I couldn't find the page you requested.</h2>
"   <?php
"   $options = us2011_get_options();
"   if (!empty($options['problem_report']))
"   "   $report = 'If you still can't find it, <a
href="'.get_permalink($options['problem_report']).'">please let us
know what you were looking for,</a> and maybe we can find it for
you!';
"   if (!empty($options['sitemap']))
"   "   $sitemap = ' or looking for it in the <a href="/
sitemap">site map</a>';
"   ?>


"   <p>You can try searching for it<?php echo $sitemap; ?>.
"   <?php echo $report; ?></p>
"   <?php get_template_part( 'searchform' ); ?>
404.php (2)
"   <?php
"   global $wp_query;
"   $wp_query->query_vars['is_search'] = true;
"   $s = str_replace("-"," ",$wp_query->query_vars['name']);
"   $loop = new WP_Query('post_type=any&s='.$s);
"   ?>
"   <?php if ($loop->have_posts()) : ?>
"   "   <p>I'm searching for the name of the page you tried to
visit... was it one of these?</p>
"    "   <ol>
"    "   <?php while ($loop->have_posts()) : $loop->the_post(); ?>
"   "   "   <li><a href="<?php the_permalink(); ?>"><?php
the_title(); ?></a>
"    "   "   "   <?php the_excerpt(); ?>
"    "   "   </li>
"    "   <?php endwhile; ?>
"    "   </ol>
    "<?php endif; ?>
RSS?
“Report a problem”


• More likely to be used than “contact”
• Automatically fill in referring URL
• Link in theme footer
Gravity Forms example
How do you
keep it simple?
Thanks!
   @sleary
sillybean.net