Sticky Posts & Sortby Custom fields
-
I found out that i can sort my posts using
query_posts(‘category_name=special-offers&orderby=meta_value&meta_key=from&order=ASC’);
before the loop
but i’m in need to put sticky posts on top (for some reason if i sort them the sticky one’s are sorted too)
so i thought that adding:
query_posts(‘caller_get_posts=0&category_name=special-offers&orderby=meta_value&meta_key=from&order=ASC’);
would do the trick, but it’s not true …Now i’m thinking about customizing the query a little harder so i can put two sort parameters, or something a-like
Or doing two loop one done only of stikies and one without stikies and sorted …
But after hours of reading i’m here to ask if someone can help me telling his idea …
And also because i think this is a bad beaviour and i think that fallback sort criteria should be added, so we can use something like
query_posts(‘orderby[]=meta_value&orderby[]=meta_value&orderby[]=title&meta_key[]=custom1&meta_key[]=custom2’)
so if two or more posts have custom field custom1 equal, the custom2 is compared and so onSry for my bad english, greetings from italy
-
Sorry, you are in the wrong forum. This forum is for those hosted here on the wordpress.COM free hosting service and we cannot do sorts or custom fields or anything like that.
You need to head over to http://wordpress.ORG/support/ which is where the self-hosted version of wordpress is supported.
-
- The topic ‘Sticky Posts & Sortby Custom fields’ is closed to new replies.