Reputation: 1800
I want to add a new post type for example news in the admin and get the post related to it . How can we do it in wordpress? Do i have to add a plugin ? Any help would be highly appreciated.
Upvotes: 0
Views: 60
Reputation: 1404
See the docs for register_post_type()
and register_taxonomy()
. Then you can use query_posts:
query_posts(array(
'post_type' => 'YOUR POST TYPE',
'taxonomy' => 'YOUR TAXONOMY FOR THE POST TYPE',
'terms' => $array_of_categories,
'orderby' => 'menu_order',
'order' => 'ASC'
));
Upvotes: 2