Forums

WP Category Posts and Wordpress 2.3 (10 posts)

  1. dtailed
    Member
    Posted 10 months ago #

    Has anyone managed to get WP Category Posts to work with Wordpress 2.3? I get a mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource instead of the list of posts.

    Thanks a lot!

  2. CrazySerb
    Member
    Posted 9 months ago #

    just open up the plugin and change this:

    $get_posts_in_cat = "SELECT $wpdb->posts.ID, $wpdb->posts.post_title, ";
    $get_posts_in_cat .= "$wpdb->post2cat.post_id, $wpdb->post2cat.category_id ";
    $get_posts_in_cat .= "FROM $wpdb->posts, $wpdb->post2cat ";
    $get_posts_in_cat .= "WHERE $wpdb->posts.ID = $wpdb->post2cat.post_ID ";
    $get_posts_in_cat .= "AND $wpdb->post2cat.category_id = '$catID' ";
    $get_posts_in_cat .= "AND $wpdb->posts.post_status = 'publish' ";
    $get_posts_in_cat .= "ORDER BY $wpdb->posts.post_title ";

    to this:

    $tp = $wpdb->prefix;
    $get_posts_in_cat = "SELECT ID, {$tp}term_taxonomy.term_id as category_id, post_title
    FROM {$tp}posts, {$tp}term_relationships, {$tp}term_taxonomy
    WHERE {$tp}posts.ID = {$tp}term_relationships.object_id
    AND {$tp}term_relationships.term_taxonomy_id = {$tp}term_taxonomy.term_taxonomy_id
    AND {$tp}term_taxonomy.taxonomy = 'category'
    AND {$tp}term_taxonomy.term_id = '$catID'
    AND post_status = 'publish'
    AND post_type = 'post'
    ORDER BY post_title ";

    should work just fine (works for me ;))

  3. dtailed
    Member
    Posted 9 months ago #

    Thank you so much! You saved me :)

  4. eduardomaio
    Member
    Posted 9 months ago #

    Thank you CrazySerb, I was looking for this too. You saved me a lot of time!

  5. ashiado
    Member
    Posted 7 months ago #

    I installed and it worked like a charm without any tinkering... Am using WP 2.3.1

  6. capstan730
    Member
    Posted 6 months ago #

    Thank you for providing this code. I upgraded to Wordpress 2.3 and got the same error message as above. I dropped your code into the plugin file and it corrected the problem. Thank you so much!

  7. syncbox
    Member
    Posted 6 months ago #

    where is this plugin? The one I've found doesn't contain the first block of code...?

  8. QuinQuin
    Member
    Posted 5 months ago #

    CrazySerb you are a genius! Thank you for helping us!!!

  9. Neboja
    Member
    Posted 4 months ago #

    @CrazySerb...

    Hello brother Serb,...(brate Srbine,pomagaj ako si Srbin...) help me...!

    Is that what you explained here according to this my "categoru problem ?"
    You can read somethig about my problem in Serbiam language

    Thanks a lot.(Hvala unapred!)

  10. Neboja
    Member
    Posted 4 months ago #

    I solved problem by changing the Theme.Previous
    Theme was incompatible with WordPress 2.3.3.

Reply

You must log in to post.

About this Topic