Support » Plugins and Hacks » [Resolved] Recent Categories FIX

[Resolved] Recent Categories FIX

  • After hours and hours of searching for a fix for this problem I was able to adapt a solution to another, simpler plugin and finally get the the Customizable Post Listings plugin to give me category results!

    I’m by no means a PHP guru, so if this is hard to follow I apologize.

    Here’s the changes you need to make:

    In LINE 44:

    global $wpdb, $tablecomments, $tableposts, $tableterm_relationships, $tableterm_taxonomy;
    if ($add_recent_comment_to_sql && !isset($tablecomments)) $tablecomments = $wpdb->comments;
    if (!isset($tableterm_relationships)) $tableterm_relationships = $wpdb->term_relationships;
    if (!isset($tableterm_taxonomy)) $tableterm_taxonomy = $wpdb->term_taxonomy;
    if (!isset($tableposts)) $tableposts = $wpdb->posts;

    In LINE 59:

    if ($categories) {
    $sql .= “LEFT JOIN $tableterm_taxonomy ON ($tableterm_relationships.term_taxonomy_id = $tableterm_taxonomy.term_taxonomy_id) LEFT JOIN $tableterm_relationships ON ($tableposts.ID = $tableterm_relationships.object_id)”;
    $cats = explode(‘ ‘, $categories);

    In LINE 75:

    $sql .= “$tableterm_relationships.term_taxonomy_id = ‘$cat’ “;

    and that is it. That’ll update the former post2cat SQL database to the current WordPress’s taxonomy system.

    I’ve tried this with two categories on the blog I’m designing and started jumping and shaking because I was so shocked. Let me know if it works for you.

  • The topic ‘[Resolved] Recent Categories FIX’ is closed to new replies.
Skip to toolbar