It is not advised to used query_post()
as it replaces the query of the page with new instance of the query. For general post queries, use WP_Query
or get_posts
.
here tag__not_in
takes id of the tag and not the slug
, so replace sold
with the id of the tag sold
like
$args = array(
'orderby'=> 'date',
'order' => 'DESC',
'tag__not_in' => sold_tag_ID
);
$allposts = new WP_Query($args);