show posts from some category and sort by advance custom field
First, you should stop using query_posts(). As said in the documentation: Note: This function isn’t meant to be used by plugins or themes. As explained later, there are better, more performant options to alter the main query. query_posts() is overly simplistic and problematic way to modify main query of a page by replacing it with … Read more