[Resolved] Random sorting of CPTs not working

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.

This topic contains 9 replies, has 2 voices.

Last updated by jamesH-10 9 months ago.

Assigned support staff: Luo Yang.

Author
Posts
#1276257

I am trying to: I created a simple test view to check the sorting of the posts but random will fail.

Link to a page where the issue can be seen: I'd rather link in private

I expected to see: Randomised order

Instead, I got: Date ordered. I can make it order by title or most other things but random fails

#1276263

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

Thanks for the details, I can log into your website and see the problem:
I assume we are talking about the post view "Online Directory", and page "Online store directory".

Please check these:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2019, deactivate all custom PHP/JS code snippets, and test again

2) If the problem still persists, please provide database dump file(ZIP file) of your website, you can get the database dump file with some mysql tools, for example PHPmyadmin, I need to test and debug it in my localhost, thanks

#1276559
#1276989

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Thanks for the details, I am downloading the files, will update here if there is anything found.

#1276997

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I can import the database dump file, here are what I found in my localhost with a fresh wordpress installation + the latest version of Toolset plugins:
1) Edit the problem page: "Online Store Directory"
I see all codes are in static HTML codes, see screenshot: Online-Store-Directory.JPG

2) I create a new page, and put the view's shortcode into the page content:
[wpv-view name="online-directory"]
Test it in front-end, I see it works fine, the results are displaying in random order, see screenshot: Online-Store-Directory2.JPG

So it should be a compatibility problem of your website, I suggest you try as I mentioned above:
1) deactivate all other plugins, and switch to wordpress default theme 2019, deactivate all custom PHP/JS code snippets
2) Create a new page, put above view's shortcode into page content, and test again.
3) If the problem is fixed, activate other plugins/theme one by one, try to locate the problem plugin/theme.

Since you are using 19 plugins and a custom theme in your website, if you need more assistance for it, please backup your website, then I can setup a demo in your website.

#1279955

Hi Luo,

I have stripped back the site so we have only two plugins - types and views and the default twentynineteen theme.

I am still unable to randomise the search results and I have also noticed that I am unable to filter for any custom fields either. I am wondering if this might be related.

Please make sure that we are testing on the staging site hidden link

I have created a test view: test-store-front and placed that into a test page: [URL]/store-front-test/

Thanks mate, your assistance is much appreciated.

#1280503

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

The test URL you mentioned above is not valid, please check it.
I have enabled the private message box, please provide the test site credentials and FTP access in it, also point out the problem page URL, thanks

#1280511
#1280531

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Thanks for the details, I have done below modifications in your website:
- Rename the folder "/wp-content/mu-plugins" to "/wp-content/mu-plugins-bak", this will be able to disable all "mu-plugins".
- Test it in front--end again:
hidden link

I can see the random order feature works fine, please check it again.

#1280685

Hi Luo,

I spoke to the guys at WP Engine and they increased the max input vars and that resolved the filter issue but not the random sort one. Do you know what might have been causing the issue?

Cheers,
Chris

#1280695

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

It seems to be a cache problem of one of those must enabled plugins of your website.
I suggest you disable all of them, enable one by one, try to locate the problem plugin.

#1282481

Thanks Luo for your help with this one. Increasing the max vars variable allowed for the filtering to work and the Random sort was actually disabled by WP Engine. There is a button at the bottom of the General Settings page in the dashboard for anyone else who encounters this issue. Turning it back on fixed the issue immediately.