Show first the posts from 1 specific tag

Is it posible only with 1 loop, to show all posts, but show first the posts in one specific tag?

The solutions i found, are using more than 1 loop.

Read More

If this is not possible, maybe if the post has a meta custom field called priority =1 , there is a solution to show this posts first.

Thank you for your help.

Related posts

2 comments

  1. You can use meta key for ordering your result.

    See reference from codex here.

    Ex.

    $args = array(
       'post_type' => 'post',
       'meta_key' => 'priority',
       'orderby' => 'meta_value_num',
       'order' => 'ASC'
     );
     $query = new WP_Query($args);
    
  2. You have probably found your solutions 1000 times by now, but have you (or would you have had) considered simply using the “Sticky” post function? It’s here for just that purpose (“prioritize” posts in the listing), but it only works (afaik) for posts (and not for custom post types).

    In the Codex:
    https://codex.wordpress.org/Sticky_Posts

Comments are closed.