getting Categories assoc with post
-
i’m using a plugin that uses php a little differently than i’m familiar with (i’m only a novice) – i want to get the categories from the query the plugin uses, like so:
[code] $pbcresults = $wpdb->get_results("SELECT * FROM $wpdb->posts, $wpdb->term_relationships,$wpdb->term_taxonomy WHERE $wpdb->posts.post_status = 'publish' AND $wpdb->posts.post_type = 'post' AND $wpdb->posts.id = $wpdb->term_relationships.object_id and $wpdb->term_relationships.term_taxonomy_id=$wpdb->term_taxonomy.term_taxonomy_id AND $wpdb->term_taxonomy.term_id =$catid_in ORDER BY $wpdb->posts.post_date DESC , $wpdb->posts.post_title ASC LIMIT $count"); foreach ( $pbcresults as $pbcresult ) { $the_output .= '<h1 class="post-title"><a>ID) . '">' . apply_filters('the_title', $pbcresult->post_title) . '</a></h1>'; $the_output .= apply_filters('the_content', $pbcresult->post_content); // need to get the Cats and Tags here... [/code]
i could figure out how to get the post_content, but can’t get an array from this query – if someone could help me, i’d appreciate it…
thanks
gn
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘getting Categories assoc with post’ is closed to new replies.