Always Remove the WordPress Version Code

July 25, 2008

Don’t want the world to know what version of WordPress you’re running? One thing I don’t think people realize is that a hacker can easily find vulnerable WordPress blogs because most standard WordPress themes will actually tell them what version you are using. If you open up the header.php file of your theme, you should notice some code that looks something like this: <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /><!-- leave this for stats --> In order to protect your WordPress... [Read the full story]

Changing the Default WordPress Gravatar

July 25, 2008

 Thousands of blogs show avatars next to their user’s comments. The avatars are a great way to make things more personal and create some variety between the different comments. In order to add the image you’ve made, you just need to take your Gravatar code and add the image URL right after the comma: Before <?php if(function_exists(’get_avatar’)){ echo get_avatar($comment, 50 );} ?> After <?php if(function_exists(’get_avatar’)){ echo get_avatar($comment, 50, '');}... [Read the full story]

Create an Archive Page for your WordPress

July 24, 2008

WordPress allows you to create page templates, so it’s possible to create manually an archive page. Before starting to code, you’ll have to choose between two different kinds of archive page. The first one will list all your posts, and will allow a direct access to every article you wrote. The only bad thing is that when your blog will have many posts, the list may be a bit too long. The second template, which is better for blogs that have been online since more than one year, will list your posts monthly and by categories. Your... [Read the full story]

Floating Images within the post in WordPress

July 22, 2008

If you’ve already upgraded to WordPress 2.6, you might have noticed that WordPress handles images a little differently than the WordPress 2.5 branch and below.  The main change is that you can now use the alt field to add a caption, which will wrap a sort of caption below the image. The problem I’ve had with this new setup is that it can cause some problems when trying to float your images due to the new class=”alignleft”, class=”alignright” or class=”aligncentered” elements.  The image will still move,... [Read the full story]

Rearrange WordPress Comments

July 15, 2008

If you have to re-arrange how the comments appeared and if for some reason you need this function all you have to do is a minor edit of /wp-includes/comment-template.php.       Original Code: // TODO: Use API instead of SELECTs. if ( $user_ID) { $comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND (comment_approved = '1' OR ( user_id = '$user_ID' AND comment_approved = '0' ) ) ORDER BY comment_date"); } else if ( empty($comment_author) ) { $comments = $wpdb->get_results("SELECT... [Read the full story]