I added a checkbox to my posts that show featured tuners. I've attached an image of the configuration. What I would like to do is sort results in my view by that custom field, allowing them to be shown first in the list. After that, I was hoping to randomize the results.
My view has custom code already that removes duplicates and hides the results until a search is performed. I've attached screenshots of the code in case it interferes with what you're trying to do. I've also attached a screenshot of an Excel example where the list is sorted, but not filtered, by a Featured column.
Is there any documentation that you are following?
This lesson mentions featured listing but doesn't tell you how to do it. I don't want to filter the results, just sort the listings with the "Featured" check first.
It does help. It looks like this will give me exactly what I want. However, it's not saving the values that I enter. I select the view, then select the changes, then select update. But when I refresh the page, the settings are back to default. The preview doesn't even show my changes.
Can you please share problem URL and admin access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
The reason why you can not change the ordering for your view because you can set the ordering for the custom fields which belongs to post type you set your view the query.
On the page:
- hidden link
Your view is set to query the intermediary post type "Platforms Tuners Intermediary Posts" and the custom field "Featured" is belongs to post type "Tuner" that is why you can not able to set order by with Featured custom field for this view.
How you want it should work?
I see only one item is set as featured:
- hidden link
When we set order by the view will display only posts where featured is set - do you want to display only featured posts with your view irrespective of what user search for but it should display only featured posts?
it doesn't seem like any of the sort items are working. I set it Random Order and that doesn't work either. So is something else wrong?
Also, there code that can, after submit is clicked:
Look at the tuner name in the first column
Query the name to determine if it's Featured
Mark it as featured
Then move it to the top?
The featured field leaves a value in all Tuner posts. Either it's a 0 or it's check marked. So it should show all of the results. Assuming it's a 1 when it's checked, it can sort in descending value with all of the 1's at the top and the 0's at the bottom.
The featured field leaves a value in all Tuner posts. Either it's a 0 or it's check marked. So it should show all of the results. Assuming it's a 1 when it's checked, it can sort in descending value with all of the 1's at the top and the 0's at the bottom.
==>
As you know the value of featured belongs to posts of post type Tuner thats what I would like to clarify that you can not sort this view with the featured custom field that belongs to post type Tuner as your view is set to query the content type (post type) intermediary post type.
It seems to partially work, but not entirely. It does look like it moves some of them up as duplicate entries. As an example, I added Original Auto as a Featured listing. However, when I do that, it duplicates the entries listed. See example pictures. Any ideas why this is? Could this be because of my other deduplication code?