Custom post order not based on anything in the database or in a custom field
-
So I have been doing some research on this for the past few hours and I am not sure if it is possible to do. I am trying to sort posts based on the amount of likes and tweets they have per post. I am retrieving the data for the likes and tweets and storing them in $likes and $tweets. Then I add the two for the total.($total) I would like to sort the posts based off of this number. (highest to lowest). Here’s where it gets tricky. I don’t retrieve the like and tweet data until AFTER the initial post query because I need to use the get_permalink() string to get the like and tweet data for each URL. So I am guessing I need to run a custom filter of some kind? not sure if this is possible…
- The topic ‘Custom post order not based on anything in the database or in a custom field’ is closed to new replies.