Saltar navegación

[Resuelto] View set to order by title ASC but not displaying that way

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:

I have several views set to display via Post title, ascending. They're displaying in random order.

Solution:

hey have Advanced Post Types Order installed, and its query was overriding Toolset's.

Relevant Documentation:

This support ticket is created hace 4 años, 7 meses. 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Etiquetado: ,

Este tema contiene 7 respuestas, tiene 3 mensajes.

Última actualización por Dave hace 4 años, 6 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#1811551

Tell us what you are trying to do?
I have several views set to display via Post title, ascending. They're displaying in random order.

Is there any documentation that you are following?
No, because it's pretty straightforward choosing from two dropdowns in the Edit View screen.
enlace oculto

Is there a similar example that we can see?
Yes: enlace oculto – there are three views all displaying incorrectly.

What is the link to your site?
enlace oculto again.

I'll be happy to provide admin access if needed.

#1811959

Nigel
Colaborador

Idiomas: Inglés (English ) Español (Español )

Zona horaria: Europe/London (GMT+01:00)

Hi Dave

If you go to Toolset > Settings > Front-end Content you can turn on debug mode for the Views, which will open a pop-up when showing the Views on the front end that contain details of the query arguments for the View and the generated SQL query. It should be possible to determine what the sorting options actually applied are that way.

If all of the Views are set to be sorted this way and none of them are displaying correctly I'd suspect a conflict from some other plugin that's modifying the query, and the simplest way to check for that is to disable all non-Toolset plugins, and possibly switch theme to twentytwenty, too.

Let us know what you find.

#1812821

Debug shows all of the sort queries being correct:

SELECT   wp_posts.* FROM wp_posts  LEFT JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id)  LEFT JOIN wp_term_relationships AS tt1 ON (wp_posts.ID = tt1.object_id) WHERE 1=1  AND wp_posts.ID NOT IN (32) AND ( 
  wp_term_relationships.term_taxonomy_id IN (28) 
  AND 
  tt1.term_taxonomy_id IN (61)
) AND wp_posts.post_type = 'sponsor' AND ((wp_posts.post_status = 'publish' OR wp_posts.post_status = 'private')) GROUP BY wp_posts.ID ORDER BY FIELD(wp_posts.ID, 3668,3886,3660,4020,3995,3707), wp_posts.post_date DESC 

Deactivating Elementor/Elementor Pro fixed this. The odd thing is that last year's version of this site does the sort correctly. The problem site is a clone of that one: enlace oculto

#1813239

It seems to be a compatibility issue, please check 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 all other plugins(Except Toolset plugins and Elementor/Elementor Pro), and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

4) If the problem still persists, please provide a copy of your website, you can put the package files in your own google drive disk, share the link only, 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/

#1819771

Thanks for the details, I am downloading the files, will update here if find any thing

#1819943
Collaborator.JPG
Stakeholder.JPG
Strategic.JPG

I have tried your duplicator package with below steps:
1) Install it in my localhost, but I trying to login into WP admin side, I get a 500 error,
2) So I have deactivated all other plugins and theme by rename the wp-content folder
3) Login your website, activate all other plugins and theme
Test it in front-end, it works fine, see my screenshots

All results are ordered by post title correctly, please try as I mentioned in my first answer:
In case it is a compatibility problem, please deactivate all other plugins(Except Toolset plugins and Elementor/Elementor Pro), and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again

This action should be able to clear cache of other plugins too.

#1825335

After all that, I figured it out. They have Advanced Post Types Order installed, and its query was overriding Toolset's. Lesson learned, I guess.

#1825337

My issue is resolved now. Thank you!