How To: Optimize Your Theme for WordPress Plugins
A couple of months ago I talked about some ways to adjust your WordPress plugin code to avoid having plugins break your blog. That post was designed to show people how to easily adjust the PHP setup for the calls for their plugins to not fail if the plugin is deactivated. I also think more theme authors should use that method to make their themes compatible with a variety of plugins out-of-the-box.
Along those same lines, there are some simple checks you can do to make sure that your theme has the best chance to be compatible with a plugin. The WordPress Expert recently posted some simple checks to verify that your WordPress theme is plugin-friendly. John recommends you verify your theme uses the following:
<?php wp_head(); ?>
<?php wp_meta(); ?>
<?php do_action('comment_form', $post->ID); ?>
<?php wp_footer(); ?>
If your theme isn’t, some plugins may not operate properly. Great post John!
How To: Adding An Author Page To Your WordPress Blog
Due to the small number of WordPress blogs that have multiple authors, very few WordPress themes seem to come with a custom author page. This means whenever someone goes to the author page, WordPress will by default use your archives.php file, or if that isn’t available, then use your index.php file. This generally doesn’t make for a very nice author page because it just displays that authors posts in the same format as your archives.
In order to create an author page, you will want to make a copy of your archives.php file and name it author.php, then upload it to your site via FTP. Now go into your theme and edit the author.php page you just created. From here, it will vary a little bit depending on your theme, but we basically have to redo the post loop for this page. A typical archive page will call the header, then finish with calling the sidebar and footer. We will be changing the code in between. Here is the code that a standard theme would use between the header and sidebar/footer calls:
<div id="content" class="narrowcolumn">
<!-- This sets the $curauth variable -->
<?php
if(isset($_GET['author_name'])) :
$curauth = get_userdatabylogin($author_name);
else :
$curauth = get_userdata(intval($author));
endif;
?>
<h3>About: <?php echo $curauth->display_name; ?></h3>
<p><strong>Website:</strong> <a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></p>
<p><strong>Profile:</strong> <?php echo $curauth->user_description; ?></p>
<h3>Posts by <?php echo $curauth->display_name; ?>:</h3>
<ul>
<!-- The Loop -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
<?php the_title(); ?></a>
</li>
<?php endwhile; else: ?>
<p><?php _e('No posts by this author.'); ?></p>
<?php endif; ?>
<!-- End Loop -->
</ul>
</div>
This will display the author’s nickname, their website, and whatever is in the description field, as well as a bulleted list of all their posts. Once set up, you can control everything from within your Users panel of your WordPress dashboard. To see a list of other arguments you can get, I recommend checking out the official WordPress Author template.
As an added bonus, if you want your authors name link to point towards the authors page, you can do so with the following code:
<?php the_author_posts_link(); ?>
Get WordPress PHP Snippets with the WordPress Help Sheet
About a week ago I was starting to work on collecting a bunch of WordPress PHP code that could be consolidated into one post for easy reference, when I ran across an incredible post that already does this. The author WPCandy calls the document a WordPress Help Sheet, and that is exactly what it is.
This document consolidates a large number of PHP code snippets into one PDF file that you can save on your hard drive for future reference, or you can print it out so its available at any time. This document seems like it would be exceptionally useful for theme authors, or anyone that likes to alter existing themes they have downloaded.

















