true, 'label' => 'Group', 'query_var' => true, 'rewrite' => array('slug' => 'group') ) ); } add_action( 'init', 'portfolie_taxonomy' ); function create_post_type2() { register_post_type( 'portfolie', array( 'labels' => array( 'name' => __( 'Portfolie' ), 'singular_name' => __( 'Item' ) ), 'public' => true, 'menu_position' => 5, 'rewrite' => array('slug' => 'portfolie') ) ); } add_action( 'init', 'create_post_type2' ); /** * This is a menu. It works with the content-type portfolie. Renders "Group" as heading and portfolie items as menu * */ function artist_menu(){ global $wpdb; /* $hold=$wpdb ; $yourCategory = 'whatever'; $yourTag = 'whatever'; $querystr = " SELECT p.* from $wpdb->posts p, $wpdb->terms t, $wpdb->term_taxonomy tt, $wpdb->term_relationships tr, $wpdb->terms t2, $wpdb->term_taxonomy tt2, $wpdb->term_relationships tr2 WHERE p.id = tr.object_id AND t.term_id = tt.term_id AND tr.term_taxonomy_id = tt.term_taxonomy_id AND p.id = tr2.object_id AND t2.term_id = tt2.term_id AND tr2.term_taxonomy_id = tt2.term_taxonomy_id AND (tt.taxonomy = 'category' AND tt.term_id = t.term_id AND t.slug = '$yourCategory') AND (tt2.taxonomy = 'post_tag' AND tt2.term_id = t2.term_id AND t2.slug = '$yourTag') "; */ $querystr="SELECT * from $wpdb->term_taxonomy where $wpdb->term_taxonomy.taxonomy='group'"; $pageposts = $wpdb->get_results($querystr, OBJECT); $r=array(); if ($pageposts): foreach ($pageposts as $post): $r[]= $post->term_id; endforeach; else : // nothing found endif; if(count($r)>0){ $querystr="SELECT * from $wpdb->terms where $wpdb->terms.term_id IN (".implode(',',$r).")"; $pageposts = $wpdb->get_results($querystr, OBJECT); } if ($pageposts){ $out="
"; return $out; }else{ return ; } } include(dirname(__FILE__).'/_functions.php'); ?>