Filter for featured questions only

Solved2.70K viewsCore
0

Hi, How do I filter using Question_Query only for featured or not featured questions?
I currently use this code:
 $args = array(
        ‘ap_order_by’ => ‘oldest’,
        ‘showposts’ => 3
    );

    $loop = new Question_Query($args);

Question is closed for new answers.
Selected answer as best
1

Hello Orlin,
At the moment this is not supported in Question_Query. But you can do a custom mysql query to get only featured questions. You can see more detail
https://github.com/anspress/anspress/blob/715edbc2d2251aad2ebf84176e572728355afc2b/includes/qaquery-hooks.php#L98
Will add this filter in our upcoming release.

Selected answer as best

Great. In the meantime, we were able to just do a regular query ordered by oldest and limit it with showposts to top 3 questions. This seems to work, ssuming there are at least three featured questions, because the featured are returned first by default and sorted separately from the rest.

You are viewing 1 out of 1 answers, click here to view all answers.