I have one question. I need to query posts from category based on the filter most favorited ( http://pastie.org/2751114 ) which is placed in custom_sort.php to my index.php page
This is how the posts from categories are called ( http://pastie.org/2751131 ) in index.php.
Is there any way to get the posts from category based on the most favorited filter?
Thank You so very much in advance 😀
query_posts
accepts custom query variable as arguments. So assuming that addingto 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:That should return the set number of posts from the category selected, in order of ‘
most_favourites
‘.Update:
To alter the the value of
sort_by
for category with ID 30 (say), put the following, after$arg
and beforequery_posts
: