/ Published in: PHP
Expand |
Embed | Plain Text
$mf_query = <<<EOF SELECT t.*, tt.*, p.* FROM {$wpdb->posts} as p, {$wpdb->term_relationships} as tr, {$wpdb->terms} AS t, {$wpdb->term_taxonomy} AS tt WHERE tt.`taxonomy` = 'bodies-of-work' AND t.`term_id` = tt.`term_id` AND tr.`object_id` = p.`ID` and tt.`term_taxonomy_id` = tr.`term_taxonomy_id` AND tt.`count` > 0 GROUP BY t.`term_id` ORDER BY p.`post_date` DESC EOF; $mf_terms = $wpdb->get_results( $mf_query ); foreach ( $mf_terms as $mf_term ) { print "\n\t\t" . '<li><a href="' . get_term_link( $mf_term, $mf_term->taxonomy ) . '">' . $mf_term->name . '</a></li>'; } }
You need to login to post a comment.
