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 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

1 Answer 1

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

 
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.