Query posts from category based on a filter most favorited
query_posts accepts custom query variable as arguments. So assuming that adding ?sort_by=most_favourites to an url alters the sort order to sort by the most favourites (i.e. you’ve set sort_by as a recognised WordPress query variable, and setting it sorts the returned posts accordingly) then, try: $args = array( ‘cat’ => $cat_lists[$i], ‘showposts’ => intval(get_theme_option_by(‘bn_list_per_item’, 6 … Read more