I am trying to:
List posts that have a value from a custom field first, then the rest. I used solution here:
https://toolset.com/forums/topic/i-need-to-display-the-featured-businesses-first-or-at-the-top-of-the-list/
Link to a page where the issue can be seen:
hidden link
I expected to see:
All posts with value 1 first followed by the rest.
This solution initially worked, I tested it quite a few times posting from back end and through my CRED form. I updated Views plugin and came back a few days later and now the sort order is not working properly.
I have a custom field with a numeric value:
Custom Field: Premium
Default Value: 2
In the sort order I have:
Order By: Field - Premium
Secondary Sorting: Post Date
I used to get before the update (values):
1, 1, 1, 2, 2, 2, 2, 2, etc
Now I get:
2, 2, 1, 1, 1, 2, 2, 2, 2, etc.
Thank you!!
Is there a chance you can send me a copy of this site where we can confirm that reverting to the older Views version solves this issue?
Then it should be relatively fast for us determining the problem.
I could maximally think of an issue in the Views settings > Order by where you'd have to set "order as numeric" when ordering by a number, as otherwise the WordPress query returns gibberish on numbers since interpreted as strings natively.
Hello,
Thanks for the details, I am downloading the files, will update here if there is anything found.
I have tried to import the your Backupbuddy file in my localhost, it does work, it stops in Step 4: Restoring Database, see screenshot step-4.JPG.
I suggest you try these:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/
2) In case it is a compatibility problem, please deactivate other plugins, and switch to wordpress default theme 2019, deactivate all Custom code snippets, and test again
3) If the problem still persists, please provide database dump file(ZIP file) of your website, also point out the problem page URL and view URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/
Thanks for the details, I am downloading the files, will update here if there is anything found
Here are what I found:
1) Please check the post view "Job Listing"
hidden link
in section "Ordering", you are using option Order by "Field - Premium" Descending
So it is expected result:
2, 2, 1, 1 etc.
2) I have tried to edit above post view, in section "Loop item in Test One ", add the field shortcode:
[types field='premium-number' format='FIELD_NAME: FIELD_VALUE'][/types]
Test it in front-end: hidden link
It works fine, see screenshot: Job-Listing.JPG
In your case, I suggest you setup the high "Jobs" posts with "Premium" field value: 2
lower "Jobs" posts with with "Premium" field value: 1
My issue is resolved now. Thank you!