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.

Digg This! | Stumble it! | Add to Del.icio.us | | Print This! |

In case you are new to the blogosphere, you might not have noticed that things tend to happen in trends. One trend that has become very popular over the last few months is the themes with date buttons.

Date ButtonIf you are wondering what I am talking about, you can actually see the date button on this theme. The picture to the left is one taken from October 16th. Adding an icon to your WordPress theme will go a long way towards improving the look of your theme, while still allowing you to provide your readers with a date to your posts.

If you are interested in adding something like this to your theme, Small Potato has a great write up explaining how to add a WordPress date button. The only step that requires a little bit of thought is getting an icon to use for the background of the date. Everything else is pretty straight forward and well explained!

Digg This! | Stumble it! | Add to Del.icio.us | | Print This! |

I’ve noticed a lot of themes that don’t come with numbers on the blog’s comments.  This might not be such a bad thing if you don’t get very many comments, but if your blog does get comments it is probably a good idea to show off how many comments you get by numbering them.

Here are the steps you can take to easily add numbers to your WordPress theme’s comments section.

  1. First thing you will want to do is create a backup your comments.php file.
  2. Locate the comments.php file.
  3. Locate the code that starts the comment loop. It will look something like this:
    <?php if ( $comments ) : ?>
  4. Place this code immediately above the code in Step 3:
    <?php $i = 0; ?>
  5. Now locate the code that looks like this:
    <?php foreach ($comments as $comment) : ?>
  6. Placed this code immediately below the code in Step 5:
    <?php $i++; ?>
  7. Now use this code where you want to display your comment numbers:
    <span class="count">
    <?php echo $i; ?>
    </span>
  8. Click Save.
  9. Now go to your stylesheet (style.css) and place this code anywhere on the stylesheet (probably best placed in the comments section):
    .count {
    float:right;
    padding: 10px;
    font-size:18px;
    color:#000000;
    }

You can adjust the stylesheet to fit your comment numbers into the placement and appearance that you want them to have.

Digg This! | Stumble it! | Add to Del.icio.us | | Print This! |

A couple of weeks ago the WordPress community was blessed with the latest release from the WordPress team, now known as WordPress 2.3. One of the included features was an extremely important and extremely useful one, which adds built-in tags to WordPress.

If you have already upgraded to WordPress 2.3 and want to take advantage of this new feature, you will probably have to manually add this tagging feature to your theme. In order to add tags, you simply need to paste the following code where you want to display the tags:

<?php the_tags(); ?>

This will actually add the text “Tags:” before the output of tags, so you will not need to do this manually. If you would like to proudly display your tags in a cloud somewhere (most commonly in your sidebar), you can easily do so by using the following code:

<?php wp_tag_cloud('smallest=8&largest=36&'); ?>

This code tells WordPress to display your tags in alphabetical order with the smallest text being 8 point font and the largest font is 36 point font. You can adjust the font sizes to your preference.

If you would prefer to stick with the Ultimate Tagging Warrior plugin, the author has stated that the plugin will be updated to work with WordPress 2.3  Most people, though, would probably prefer to switch to the new built-in tagging system. If you’d like to make the switch from UTW to the new WordPress tagging system, WordPress has made it easy to make the conversion with their import feature. You can find the import option under the Manage tab in your Dashboard. In addition to the ability to import your UTW tags, WordPress also allows you to import tags from other plugins such as Bunny’s Technorati Tags and the Simple Tagging plugin.

Overall, I am extremely impressed with the new tagging feature found in WordPress 2.3 and even more impressed with how easy it is to convert your old tags to the new system.

Digg This! | Stumble it! | Add to Del.icio.us | | Print This! |

Today I ran across a great post over at Web Designer Wall that I thought I would share with everyone. In the post, Nick La covers a wide variety of WordPress Theme Hacks that web designers that use WordPress will find useful. Some are pretty basic, but Nick provides the code for a few more advanced techniques as well.

Here are a few of the techniques that you’ll find the code for:

  • Dynamic Highlight Menu
  • Dynamic Content
  • Dynamic Title Tags
  • Dynamic Subpage Menu
  • Featuring Posts

Click over to check out the rest of the code provided!

Digg This! | Stumble it! | Add to Del.icio.us | | Print This! |

With all the WordPress themes available to WordPress users, it always surprises me how these incredible theme authors don’t take a few extra seconds to separate their theme’s trackbacks from the comments. It doesn’t look very professional and it can make it extremely difficult to follow a conversation in the comments.

Separating your trackbacks and comments requires a minimal amount of coding work to set up. First, you’ll want to make a backup of your comments.php file just in case something goes wrong. Next, follow these three steps:

1 ) Access your comments.php file and locate the following code:

<?php foreach ($comments as $comment) : ?>

Immediately after the above code, you’ll want to place this code:

<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type == 'comment') { ?>

2 ) Next, you’ll want to scroll down a little bit and locate the following code:

<?php endforeach; /* end for each comment */ ?>

Immediately before the above code, you’ll want to place this code:

<?php } /* End of is_comment statement */ ?>

This will filter out all of the trackbacks and pingbacks from your main comments loop. Now we need to create a second comments loop to display the trackbacks and pingbacks.

3 ) Almost immediately below the code from step 2 you should find this code:

<?php else : // this is displayed if there are no comments so far ?>

Immediately before the above code, you’ll want to place this code:

<h3>Trackbacks</h3>
<ol>
<?php foreach ($comments as $comment) : ?>
<?php $comment_type = get_comment_type(); ?>
<?php if($comment_type != 'comment') { ?>
<li><?php comment_author_link() ?></li>
<?php } ?>
<?php endforeach; ?>
</ol>

You can adjust this code to display how you want to, including using a different header if you have a specific look for your header 3.

Digg This! | Stumble it! | Add to Del.icio.us | | Print This! |