Query Custom taxonomy in wordpress 3
-
Hey, I got a small problem that I am unable to solve, hope someone can help me on this:
I am using the WP3 RC 1 Version and registered a new post type along with a new taxonomy for that type:
add_action('init', 'portfolio_register'); function portfolio_register() { $labels = array( 'name' => _x('Portfolio Items', 'post type general name'), 'singular_name' => _x('Portfolio Entry', 'post type singular name'), 'add_new' => _x('Add New', 'portfolio'), 'add_new_item' => __('Add New Portfolio Entry'), 'edit_item' => __('Edit Portfolio Entry'), 'new_item' => __('New Portfolio Entry'), 'view_item' => __('View Portfolio Entry'), 'search_items' => __('Search Portfolio Entries'), 'not_found' => __('No Portfolio Entries found'), 'not_found_in_trash' => __('No Portfolio Entries found in Trash'), 'parent_item_colon' => '' ); $args = array( 'labels' => $labels, 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => true, 'show_in_nav_menus'=> false, 'menu_position' => 5, 'supports' => array('title','thumbnail','excerpt','editor') ); register_post_type( 'portfolio' , $args ); register_taxonomy("portfolio_entries", array("portfolio"), array( "hierarchical" => true, "label" => "Portfolio Categories", "singular_label" => "Portfolio Categories", "rewrite" => true, "query_var" => true )); }
now when i use
query_posts(post_type=portfolio)
that works fine but i need to select the different categories as well wich doesnt work:query_posts(post_type=portfolio&cat=2,3,4)
did i forget to set any arguemnts that are neccessary? Thanks for your help!
Regards Kiraa
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Query Custom taxonomy in wordpress 3’ is closed to new replies.