Add new Gravatars to WordPress default gravatar list
January 25, 2009
Avatars are popular as identification and with the service Gravatar it is largely used in the comment area of different applications. WordPress allows you to choose a default gravatar to be displayed on your comments when the commentator don’t use Gravatars. But what if you wan to add more avatars to the list? That’s easy: simply apply this simple method. Various themes have a standard Avatar to match the design. But even here there is a nice solution via a hook, which enables to add an avatar in the list of your backend... [Read the full story]
Manually define to show full post or excerpt on your homepage
January 23, 2009
Do you use excerpts or full posts on your blog excerpts? Personnally, I think they’re both good. The only problem is that you can’t, by default, use both excerpts and full posts on your blog homepage. Here’s a code to do it. On your index.php file, replace your current loop by this one: <?php if (have_posts()) : while (have_posts()) : the_post(); $customField = get_post_custom_values("full"); if (isset($customField[0])) { //Custom field is set, display a full post ... [Read the full story]
Display wordpress category name without link
January 23, 2009
When you’re using the the_category( ) function to display the category name of a post, a link to the category archive is automatically created by WordPress. While this is a good thing in most cases, what if you don’t want to create a link? Here’s an easy way to do it. To display the category name without haveing a link to the category archive being automatically created, simply open replace the_category( ) by the following code: <?php $category = get_the_category(); echo $category[0]->cat_name; ?> Read More →
Limit search to specific categories of wordpress
January 23, 2009
If for some reason, you’d like to exclude some categories from searches, you have to tweak WordPress a bit because there’s no built-in solution to this problem. Happilly, here’s a code to do that job. Replace the categories IDs on line 3 and paste the following code on your search.php template: <?php if( is_search() ) : $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("s=$s&paged=$paged&cat=1,2,3"); endif; ?> Read More →
Display the last image attached to post using shortcode
January 20, 2009
First, you have to paste the following code in your functions.php file, in order to create the shortcode. function sc_postimage($atts, $content = null) { extract(shortcode_atts(array( "size" => 'thumbnail', "float" => 'none' ), $atts)); $images =& get_children( 'post_type=attachment&post_mime_type=image&post_parent=' . get_the_id() ); foreach( $images as $imageID => $imagePost ) $fullimage = wp_get_attachment_image($imageID, $size, false); $imagedata = wp_get_attachment_image_src($imageID,... [Read the full story]


















