Currently Browsing
WordPressThere are quite a handful of different post thumbnail solutions out there, but it seems that I found a very simple and compatible one that uses the famous timthumb library. Add this code to your functions page, functions.php: function post_image() { global $post, $posts; $thumb = ”; $output = preg_match_all(‘/<img.+src=[\'"]([^\'"]+)[\'"].*>/i’, $post->post_content, $matches); $thumb = $matches [...]
Like I promised in a previous post, here is the code required to show latest 5 posts followed by 15 more, like on my homepage. You need to edit the index.php template and add 2 sub-loops separated by wp_reset_query(). Simple as that. Here is the entire index.php code (you should be able to pull the [...]
During the weekend I updated no less than 15 WordPress blogs. The operation went as smooth as a baby’s butt, and hours later, plugin updates starting pouring in. Thanks to the mass updater feature, I was able to install them all at once. If you’re a developer and you’re interested in what’s new when a [...]
I was doing some research the other day to minimize the space occupied by my single-worded categories, and I found a nice way to do it. Add the following to your CSS stylesheet: .right {float:left; width:160px;} .left {float:left; width:160px;} Add the following to your sidebar, making sure you respect the widget styles: <div class="widget_box"> <h3>Categories</h3> [...]
First of all you need the Simplepie library. You only need the simplepie.inc file included in the archive. My example extracts 5 items from a recipe blog: <div class="block"> <h2>Latest Culinary Recipes</h2> <div class="content"> <?php $feed = new SimplePie(‘http://www.wordpress-site.com/feed’);?> <ul> <?php foreach ($feed->get_items(0, 5) as $item): ?> <li>» <a href="<?php print $item->get_permalink();?>"><?php print substr(($item->get_title()),0,23);?> [...]</a></li> [...]
I just launched my first WordPress plugin. I needed an easy way to access the MySQL database without going to cPanel for each of my clients’ blogs. So I developed a wrapper for phpMyAdmin, and you can now access it straight from your WordPress Dashboard. Read more and download Portable phpMyAdmin plugin here. Stay tuned [...]
I have updated 3 of my current themes to work with WordPress 2.7 at full potential. This includes threaded comments, pagination and sticky features. The updated themes are: Whiskey Air [download 2.7 compatible only] Whiskey Earth [download 2.7 compatible only] Light Constellations [download 2.7 compatible only] Visit my themes repository for older versions.
Recent posts: <?php wp_get_archives(‘title_li=&type=postbypost&limit=10′);?> Multiple loops? Same template? WP Query not working after the first loop? Use <?php wp_reset_query();?> Too small a post? Tweet it!
I’ve been working on tweaking some themes, and I decided to remove all widgets and hardcode content boxes straight into the sidebar template file. So, here’s how to add a box with most popular (commented) posts: <div> <h2>Popular Content:</h2> <div> <ul> <?php $result = $wpdb->get_results("SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , [...]

















WordPress Most Commented Articles During The Year
Chip on 23 November 2009 | 2 commentsAs the end of the year is getting closer and closer, you might want to show a top ten most commented articles. By modifying the code you could display a top 3, top 15, top 100, or whatever number you like. Here’s how: <div> <h2>Most commented articles in 2009</h2> <div> <ul> <?php $result = $wpdb->get_results("SELECT [...]