Use Categories In Custom Post Query
-
Hey Guys…
(Have I ever mentioned how much I love this community? Well…I do!)I was wondering how I can query regular ‘post’ categories in custom posts? I figured out a simple query for the post, but I would like to add the category.
I’m a bit confused by the command in the functions file which calls the taxonomies to be categories:
‘taxonomies’ => array(‘category’),
I haven’t had much success with ‘cat => 3’ in my query.
I know in custom posts–which is kind of frustrating–you can’t query the taxonomy. So I’m wondering if there’s a conflict somewhere? Should I be calling the taxonomy instead?
Any help would be much appreciated.
Here’s my query:
`<?php
query_posts(array(
‘post_type’ => ‘events’,
‘order’ => ‘ASC’) );
?>``
The topic ‘Use Categories In Custom Post Query’ is closed to new replies.