$el) {
//$items = get_posts(array('post_type' => $d, 'numberposts' => 20, 'exclude' => array($this->post_id)));
$items = $wpdb->get_results( "SELECT `ID`, `post_title` FROM {$wpdb->prefix}posts WHERE post_type = '{$d}' and post_status = 'publish' LIMIT 20" );
if( is_iterable($items) && count($items) > 0 ){
echo '
';
echo '
'.get_post_type_object($d)->label.'
';
echo '
';
echo '
';
}
if( is_iterable($el) && count($el) > 0 ){
foreach ($el as $term) {
//$cats = get_terms( $term, array( 'hide_empty' => false ) );
$cats = $wpdb->get_results( "SELECT tt.term_id, te.name FROM {$wpdb->prefix}term_taxonomy tt INNER JOIN {$wpdb->prefix}terms te ON tt.term_id = te.term_id WHERE tt.taxonomy = '{$term}' Limit 20 " );
if( !empty($cats) && !is_wp_error( $cats ) ){
echo '
';
echo '
'.get_taxonomy($term)->labels->name.'
';
echo '
';
echo '
';
}
}
}
}
?>