Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to query posts from a taxonomy created by a plugin (WP Business Directory Manager). How would I do this? I want the query to create html listing of the posts and allow me to list a certain amount, show the associated image to the posts, and a small excerpt.

Some examples on wp stack exchange seem like they would help, but might be different in my case. Thanks a lot.

share|improve this question
    
query posts that have a specific taxonomy term associated with them, or posts that have at any/at least one term from that taxonomy associated with them? –  onetrickpony Dec 21 '10 at 11:12
    
Yes sorry for leaving that piece of info out. The taxonomy name is wpbdm-category and the post-type is wpbdm-directory. –  user1893 Dec 21 '10 at 13:42
add comment

1 Answer

up vote 3 down vote accepted

To query by taxonomy you need to know its query_var that is used in its register_taxonomy() call. It defaults to taxonomy name so usually equal to that.

Then you use that info in query argument:

query_posts( array( 'query_var' => 'term' ) );

See Querying by taxonomy in Codex.

It is hard to suggest more without specifics of your taxonomy and where you need it done (template, standalone function, etc).

share|improve this answer
    
Thanks a lot, the name of the taxonomy is wpbdm-category and the post type is wpbdm-directory. The plugin that created these is WP Business Directory Manager (might be helpful). –  user1893 Dec 21 '10 at 13:39
    
i think it's better if you use 'post_type' => 'wpbdm-directory' in this case. –  onetrickpony Dec 21 '10 at 14:50
    
Yes, it worked. Is there a way to query the post content/excerpts? I want to replicate the listings in the directory and list them on the homepage. Can this be done? –  user1893 Dec 21 '10 at 15:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.