Display your average comments per wordpress posts
February 9, 2009
Do your blog gets a lot of comments? Here is an easy way to know the average comments per posts on your WordPress blog, using new functions introduced in WordPress 2.7. Simply paste the following code anywhere on your theme, where you’d like the average comments per post to be displayed: <?php $count_posts = wp_count_posts(); $posts = $count_posts->publish; $count_comments = get_comment_count(); $comments = $count_comments['approved']; echo “Average “.round($comments/$posts).” comments per post.”; ?> This... [Read the full story]
Separate each wordpress post with an image
February 8, 2009
First, you need an image. Once you have it, upload it to your wp-content/themes/yourthemes/images directory, open up your index.php file, find the loop and make sure that each post is embedded throught a <div class=”post”> tag. This is the case on most themes. Then, edit your style.css file. Find the following line: .post { And paste this code: background: transparent url(images/yourimage.jpg) no-repeat bottom; Read More →
Display your feedburner count in full text
February 6, 2009
Are you using feedburner? Probably yes, just as a lot of wordpress bloggers do. If you don’t like the chicklet dedicated to display your feedburner count, just read this recipe which is a new method to get your feedburner count in text mode. To display your feedburner count in full text on your WordPress blog, simply paste the following on any of your theme file, for exemple sidebar.php: <?php $fburl=”https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=YourURL“; $ch = curl_init(); curl_setopt($ch,... [Read the full story]
Style wordpress posts individually
February 4, 2009
To be able to style posts individually, you have to edit your single.php file and find the line starting with: <div class="post"> Simply change this line to: <div class="post" id="post-<?php the_ID(); ?>"> Once you saved the file, you can style an individual post by using the #post-XXX id: #post-xxx { background: #113355; color:#069; font-weight:bold; } Read More →
Randomize wordpress posts order
February 3, 2009
Are you building a portfolio or a gallery with WordPress? If yes, it can be a good thing to randomize posts order, that’s very easy to do with WordPress. To randomize posts order, you’ll have to use the very powerful query_posts() function before your WordPress loop: query_posts('orderby=rand'); //Your loop goes here Of course, it is also possible to randomize only a certain category: query_posts('cat=8&orderby=rand'); //Your loop goes here Read More →



















