WP_Query mixe post and page attributes

I am working on a website developed by someone else (it’s a bit messy).
Now I have to make a small widget to let the users search for some of the content that has been created.
I need to be able to make a search on posts and pages, but also define several carac to the search.
For example mixing a search for a posts that belong to a dedicated parent AND pages which belong to a specific category.

I tried something like that :

$arguments = array(
        'post_type'=> array('post','page'),
        'post_parent__in' => array('58'),
        'category_name' => 'case-study',
        'order_by'=>'DESC',
        'posts_per_page'=>'20'
    );

But I think I’m probably missing an OR case somewhere since I don’t receive any results.

I have looked at the codex but isn’t able to find a correct search for my query.

Can somebody help please?

Thank you.

0

Leave a Comment