Archive for the ‘Wordpress’ Category
Creating A Wordpress Theme
Saturday, March 14th, 2009This tutorial will show you how to build a custom WordPress theme. Although the Codex site provides very good documentations on how to create a theme, but I find it too complicated for a beginner. In this tutorial the basics of how WordPress theme works and show you how to convert a static HTML template into a theme will be explained. No PHP skill is required, but you need Photoshop and CSS skills to create your own design.
1. The Blog Frontend
Before you start, let’s take a look at the WordPress default theme and see how it is structured. Take note of the elements (header, post title, search form, navigation, footer, etc.).

Default Frontpage (index.php)

Default Single (single.php)
Another 10 Wordpress Hacks
Friday, January 2nd, 2009Displaying Gravatars in comments
To refresh your memory, Gravatars are little user images from Gravatar.com that are displayed against your comments in the theme (if the theme is built to support Gravatars). A lot of WordPress themes are built without the support of Gravatars. So, here is some help for you to add Gravatars in your theme. Open up your comments.php file from the theme folder. Find this piece of code :-
<?php comment_text() ?>
Replace the above code with the following code :-
<div class="gravs">
<?php if (get_bloginfo('version')>=2.5)
echo get_avatar( $comment->comment_author_email, $size = '50', $comment->comment_author_link);?>
<?php comment_text() ?>
</div>
<br clear="all" />
The above code will display the Gravatars. Now let us add some CSS to the style.css file for your theme.
.gravs {margin-top:20px;}
.avatar {float:left; margin-right:5px; margin-bottom:5px; padding:3px; border:1px solid #999999;}
When you check your theme again, you will see the Gravatar images against your comments. (more…)



