WordPress Cheat Sheet
Listed below is the code that I use most in WordPress. I will be adding to it on an ongoing basis. If you have a question about how to use any of the code please feel free to add a comment at the bottom of the page.
http://yourURL.com/wp-content/themes/yourThemeName
Example:
<img src="<?php echo bloginfo('template_directory').'/images/title.gif'; ?>">
is the same as:
<img src="http://yourURL.com/wp-content/themes/yourThemeName/images/title.gif">
<?php $image = get_post_meta($post->ID, 'image', TRUE); ?>
<?php if($image) { ?><img src="<?php echo $image; ?>" alt="Alt Text" /><?php } ?>
<?php endwhile; // end of the loop. ?>
If the page title is Contact then this will execute
}
Category&showposts=10'); ?>
<?php while (have_posts()) : the_post(); ?>
// The Stuff... Custom HTML & PHP Code
<?php endwhile;?>
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
$wp_query->query('category_name=blog&showposts=10'.'&paged='.$paged);
while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<!--Print out the info -->
<div class="blogtitle"><a href="<?php the_permalink() ?>"><h2><?php the_title() ?></h2></a></div><div class="blogtime"><?php the_time() ?> | <?php the_date() ?> | <?php the_author(); ?> | <?php the_tags(); ?></div>
<?php $image = get_post_meta($post->ID, 'image_home', TRUE); ?>
<div class="blogimage"><a href="<?php the_permalink() ?>"><img src="<?php echo '/'.$td.'/scripts/timthumb.php?src=/'.$image.'&h=0&w=445&zc=1' ?>" /></a></div>
<div class="blogexcerpt"><?php the_excerpt() ?></div>
<div class="bloghr"><hr></hr></div>
<?php endwhile; ?>
<div class="blogpage"><?php pagination( $wp_query, "/" ); ?></div>
<?php $wp_query = null; $wp_query = $temp;?>
$page = $query->query_vars["paged"];
if ( !$page ) $page = 1;
$qs = $_SERVER["QUERY_STRING"] ? "?".$_SERVER["QUERY_STRING"] : "";
// Only necessary if there's more posts than posts-per-page
if ( $query->found_posts > $query->query_vars["posts_per_page"] ) {
echo '<ul class="paging">';
// Previous link?
if ( $page > 1 ) {
echo '<li class="previous"><a href="'.$baseURL.'blog/page/'.($page-1).'/'.$qs.'">previous</a></li>';
}
// Loop through pages
for ( $i=1; $i <= $query->max_num_pages; $i++ ) {
// Current page or linked page?
if ( $i == $page ) {
echo '<li class="active">'.$i.'</li>';
} else {
echo '<li><a href="'.$baseURL.'blog/page/'.$i.'/'.$qs.'">'.$i.'</a></li>';
}
}
// Next link?
if ( $page < $query->max_num_pages ) {
echo '<li><a href="'.$baseURL.'blog/page/'.($page+1).'/'.$qs.'">next</a></li>';
}
echo '</ul>';
}
}
In you functions.php file there is a function called “function your theme-name_comment”
Find the line:
<?php echo get_avatar( $comment, 40 ); ?>
Replace with:
$author = get_comment_author_link();
if ($author == "admin"){
echo get_avatar( 'your admin email', $size = '40', $default = 'url to image' );
}
if ($author != "admin"){
echo get_avatar( $comment, 40 );
}
In you functions.php file there is a function called “function your theme-name_comment”
Find the line:
echo get_avatar( $comment, $avatar_size );
Replace with:
$avatar_size = 68;
if ( '0' != $comment->comment_parent )
$avatar_size = 39;
$author = get_comment_author_link();
if ($author == "admin"){
echo get_avatar( 'info@bee-software.net', $avatar_size, $default = 'http://bee-software.net/wp-content/themes/beetheme02/images/comment/icon.png' );
}
if ($author != "admin"){
echo get_avatar( $comment, $avatar_size );
}
//disable auto p
remove_filter ('the_content', 'wpautop');
//disable wptexturize
remove_filter('the_content', 'wptexturize');

Nice collection of snippets; bookmarked for future reference.
You might find this WordPress Reference Guide for Web Developers useful. It includes several tags to customize your WordPress, displayed in an easy to read fashion that will expedite your coding process. Check out the WordPress Reference Guide from DBS>Interactive.