WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I now that WP_Query can query by post_type and category but i need to get data from custom post type or from category which is standard post type. Adding category to my custom post type is not an option. Any suggestion how to aproach this?

share|improve this question
Here's a really good link to all the available args available for WP Query. – David Paulsson Mar 20 '13 at 9:57
Problem is that I have to get from custom post type (everything) and normal posts from category. Standard query will get my post which ar in custom post type and in this particular catergory. – stamp Mar 20 '13 at 10:13

Found solution

    $posts = array_merge($posts1, $posts2);
    function cmp($a, $b) {
         return strcmp($a->post_title, $b->post_title);
    usort($posts, 'cmp');
share|improve this answer

Your Answer


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.