Skip Navigation

[Resolved] How do I sort my archive view by custom field values?

This support ticket is created 4 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by sheaN 4 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#1895817

Tell us what you are trying to do?

I'm trying to sort my archive view, I want all posts sorted by the custom field values of "Grad Year" & "Rating". So highest rated and the one's that are graduating the soonest are at the top.

Is there any documentation that you are following?
No

Is there a similar example that we can see?
My example, only I want all the "5 star rated" on top of the archive list.
hidden link

What is the link to your site?

hidden link
hidden link

#1896513

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Shea,

Thank you for getting in touch. You should be able to sort your archive by a custom field value, however you can only sort it by 1 custom field and not both.

Custom code will be required to sort the archive by multiple custom field values.

Thanks,
Shane

#1896603

Thanks Shane,

Where exactly is the option on the backend to change the sorting?

#1896613

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2021-01-06 at 3.55.40 PM.png
Screenshot 2021-01-06 at 3.55.46 PM.png

Hi Shea,

Currently there are 2 methods on how to do this.

However I would need to know which archive option are you using. Are you building the archive with the Block editor ? If so when you use the block navigation tab in the top left hand screen you should see the Block tab appear for the archive.

Just scroll down to the Ordering Settings. See Screenshot.

If you are using the Classic Editor for the archive, just go to the archive and scroll down to the ordering section.

Please let me know if this helps.
Thanks,
Shane

#1897793
order.png
error.png

Hi Shane,

I clicked the block navigation tab, then click on the view. In the right hand column, I have no option to sort by any field, the only option it gives me is "Sort Direction".

I am also getting a red error bar with the message "Something went wrong while fetching the dynamic content from the selected source, with message: "The response is not a valid JSON response."

I've attached both images for you to see.

Thanks again.

#1897825

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Shea,

If the option is not there then there is something else happening here.

Are you able to temporarily disable all the non-toolset plugins and check again ? Secondly after disabling and the issue still remains can you provide me with admin access to the check the site ?

I've enabled the private fields for your next response.

Thanks,
Shane

#1897877

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2021-01-07 at 2.32.13 PM.png

Hi Shea,

Thank you for the credentials, I tried to access the site but it seems that I am now blocked by some security plugin. See Screenshot.

If you need my IP to unblock me here it is 69.160.102.5

Thanks,
Shane

#1897887

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2021-01-07 at 2.36.05 PM.png

Hi Shea,

The issue seems to be the page that the view is on. When I added the view to a different page as a test it works. See Screenshot

Please try adding the view to a different page and let me know if this works on your end.
Thanks,
Shane

#1897987

Yes, that worked for me, I just re-created the page, and swapped them out, it's now sorting for me. Thank you for the help Shane!