Order posts by date, but also give priority for a specific term

is it possible to query posts ordering them by date, but also give priority for a specific term? I want posts from this term to be always on top, followed by the posts of the other taxonomies.

$paged = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
    $query_args = array(
    'post_type' => 'topics',
    'posts_per_page' => 12,
    'paged' => $paged,
);
$query = new WP_Query($query_args);
if($query -> have_posts()):while($query -> have_posts()):$query -> the_post();

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

There are no default sorting to show a specific term posts on top of others. So need some tricks to achieve it. You can check this answer, should be helpful.
https://wordpress.stackexchange.com/a/161168/102213


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x