Subscribe via

Alex King’s “Articles” Plugin Mod

Alex King’s ‘Articles’ is a great plugin that lets you easily mark posts as featured articles. You can also display a list of featured posts on a selected page/post by placing a “&#35&#35&#35articles&#35&#35&#35” tag in it. That said, there are TWO big problems with it:

  1. It doesn’t work with WordPress 2.3.x or 2.5.x
  2. It displays the same article in each category that the post is listed under. So that means if your featured post is filed under 5 categories, your post will show up 5 times on your featured articles list.

Andy Cowl has already resolved issue #1 on this WordPress support thread (THANK YOU!). Here are the changes Andy Cowl did.

+++ articles.php        (working copy)
@@ -96,13 +96,11 @@
        $cats = $wpdb->get_results("
                SELECT $wpdb->term_relationships.object_id, $wpdb->terms.term_id, $wpdb->terms.name, $wpdb->terms.slug
-               FROM $wpdb->term_relationships
-               LEFT JOIN $wpdb->terms
-               ON $wpdb->term_relationships.term_taxonomy_id = $wpdb->terms.term_id
-               LEFT JOIN $wpdb->term_taxonomy
-               ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id
-               WHERE $wpdb->term_relationships.object_id IN (".implode(',', $post_ids).")
-               AND $wpdb->term_taxonomy.taxonomy = 'category'
+               FROM $wpdb->term_relationships, $wpdb->term_taxonomy, $wpdb->terms
+               WHERE $wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id
+               AND $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id
+               AND $wpdb->term_taxonomy.taxonomy = 'category'
+               AND $wpdb->term_relationships.object_id IN (".implode(',', $post_ids).")
                ORDER BY $wpdb->terms.slug, $wpdb->term_relationships.object_id DESC
        ");

On issue #2, I’m thinking about modifying this plugin to accept another custom field called “article_category” to accept a string value of your category slug. Let’s say you feature a post that has 5 categories and set “article_category” custom field to “blogging” then the post will only show up once under the “blogging” category on your featured articles page. What do you guys think of this mod? If there is some demand for this, I will definitely move this to the top of my stack of projects and crank this out in a few hours. Please let me know via comments.

Widget Bugs or Features in WordPress 2.5?


This might be useful for WordPress widget developers out there. I wasn’t going to post this before, but I just found that another developer ran into the exact same issue. So hopefully the 10 minutes I spend writing this post can help save somebody hours of debug.

After WordPress 2.5 released I found that my NowThen Photo Display widget broke the sidebar management page in WordPress adminitration. I took the longest time to figure out why, but the root of the problem was that the new WordPress 2.5 actually executes widget code in the wp-admin area. I have no idea why this is the case. Is this a bug or a feature of the new 2.5 code? I can see it as a feature in a sense that, if the code is not able to executed properly in the wp-admin area, then it should not be added to the front-end. If that’s the case, I would expect an error message rather than a broken sidebar management page.

Anyhow, here are a couple of tips that I have if your plugin breaks after the upgrade: Read on…

Make WP-PostViews Work with WP-Super-Cache

In response to JTPratt’s comment on my post, ‘Make Popularity Contest Work with WP-Super-Cache,’ I am releasing a modification of Lester Chan’s WP-PostViews plugin to support counting using Javascript. Please try it out to see if this works for you.

A side note to Lester Chan and Richer Yang (WP-PostViews and WP-PostViews Plus authors repectively). Please feel free to contact me about incorporating these changes into WP-PostViews and/or WP-PostViews Plus so that it can be officially committed to the wp-plugins.org repository. I would create my own version of WP-PostViews in the repository, but do not want to steal your thunder :).

Read on…

Make Popularity Contest Work with WP-Super-Cache

Previously I wrote ‘Make Your WordPress 10X faster During Traffic Storms‘, which is a post about automatically turning WP-[Super]-Cache on/off and automatically switching your WordPress theme to a lighter theme during heavy traffic. One of the main reasons that I had this setup was because I could not get statistics to work with WP-Super-Cache (i.e. my chCounter & Popularity Contest plugin is hosed).

After some tinkering, I was able to get chCounter and Popularity Contest to work with WP-Super-Cache. This involves using javascript to count instead of PHP. chCounter was a simple change, but Popularity Contest was a bit more challenging. Usually I would immediately post the “How-to” here, or rather release the modded plugin to the public myself, but I believe that I shouldn’t step on Alex King’s shoes (the original developer of Popularity Contest). I’ve sent the Popularity Contest code to Alex for code review. He’s been doing some of the same work, and hopefully he can incorporate some of my changes into the plugin and release it to the public soon.

If anybody would like to use my version of the Popularity Contest before Alex King releases it to the public, you may download the WordPress 2.3.3 and WordPress 2.5 compatible version here:
Read on…

Nowthen Photo Display WordPress Plugin

This plugin is no longer supported/updated because of low demand for the plugin.

Today I would like to announce the release of “Nowthen Photo Display” WordPress widget that parses picture RSS feeds from the image service nowthen.com and displays the pictures neatly on the sidebar. This is my first WordPress widget so any comments and suggestions are welcomed. I would be happy to make updates/releases if the demand for this widget is high enough and there are some worthwhile feature requests.

Screenshots

Sidebar Widget
Sidebar Widget
Widget Options
Widget Options
Gallery
Gallery
Gallery Options
Gallery Options

Read on…