Forums › Forums › Search & Filter Pro › Taxonomy problem and Reset Filters
Tagged: CPT Injector, Divi
- This topic has 44 replies, 3 voices, and was last updated 7 years ago by Ross.
-
Ross Moderator(Private) August 23, 2017 at 11:10 am #127228
Hey Alessandro
I’ll; be back on this asap, my “todo list” is enormous and am working through everything 1 by 1 ๐
Will update later on today.
Thanks
Ross Moderator(Private) September 15, 2017 at 2:07 pm #131284I’m working on this right now ๐
Getting to grips with DIVI to see what you did differently, as out of hte box DIVI doesn’t seem to cause the issues you are having :/
Will update as soon as I know more
Ross Moderator(Private) September 21, 2017 at 3:28 pm #132333This reply has been marked as private.Ross Moderator(Private) September 22, 2017 at 6:06 pm #132581This reply has been marked as private.Ross Moderator(Private) October 5, 2017 at 8:53 pm #135015Hi Alessandro
Finally I figured it all out.
It was a bit of a learning curve using divi (as I rarely use themes with layout builders) but I figured out the exact issue.
So, to explain:
To use S&F with archive mode (as in, S&F filtering your CPT archive) everything is setup ok and working ok.
To use S&F with AJAX, and archive mode, is not working, and this is the problem. What S&F requires, is that the layout of your archive page, must remain the same even if the filter / search has no results – or another way of looking at it, the archive layout must be the one defined in the divi library, even if no posts have been created yet for that custom post type.
So, why is this a problem now?
Well, the behaviour I describe is actually default WP behaviour.
Open any install of WP, open any archive (whether that is Category, Custom Post Type etc etc).
Now, simply append
?s=a
to the URL… which searches within the current archive.. This is default WP behavior (no S&F working here, disable it if you need). You will see the archive is filtered by this search term.Now, change the value to something which does not exist:
?s=doesnotexist
You will see, the page layouts are 99% of the time, the same as the current archive, but the post list will be empty.
This means, the 404, or no results message, is displayed using the same archive template (usually), that is used for displaying results, when there ARE results – does that make sense?
Now the problem is actually with the plugin you are using to display your archive templates –
PT Layout Injector
The problem is, the plugin is doing a fantastic job of injecting your specific layout to your custom post type archive, but once a search is performed that does not have any results, the layout injector stops working, and shows a default 404, using your themes default layout – BUT it should still be using the archive layout you have defined, if it keeps in line with default WP behaviour – in this case it completely breaks continuity of your archives.
EG, where is the sidebar on this page? https://www.erasmuspeople.com/erasmus_trips_milan/?s=afsdfs
As mentioned, this should work out the box, and if you had customised your archive template using wordpress standards then I think this would have worked fine.
Anyway, that is the current state of affairs – if that plugin doesn’t support showing the correct template, when there are not results found, then this can’t be officially supported..
But fear not, I did some hacking / testing and found a work around (next post, for legibility)…
-
AuthorPosts