Skip Navigation

[Resolved] Search Results in Post Archive with Broken Layout on Second Page of Pagination

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/Karachi (GMT+05:00)

This topic contains 13 replies, has 2 voices.

Last updated by Waqar 10 months, 2 weeks ago.

Assisted by: Waqar.

Author
Posts
#2678988
screenshot-1.png

I have a posts archive with pagination enabled, and when I run a text search and advance to the next page of results, I get this:
hidden link

The pagination otherwise works just fine if I don't have an active search query in my URL parameters. See here:
hidden link

I've adjusted Divi's settings to reflect the number of posts I expect to see on a single page of results (see attached), as I heard that might cause a conflict, but that doesn't seem to be the issue.

Another thing of note, is that I have this same kind of archive configuration on another site, something of which I've copied onto multiple sites, actually, and I'm only just now seeing this (hidden link), so I don't know what I'm doing differently here that's causing an issue.

Any help in this matter would be greatly appreciated, thanks in advance!

#2679091

Hi,

Thank you for contacting us and I'd be happy to assist.

I've performed some tests on my website with a similar archive and search settings, but couldn't reproduce this.

Interestingly, on your website, the CSS styles also seem to be broken only if the specific text 'peer specialist' is used. It doesn't happen if some other text like 'home' or 'call' is used.

I'll recommend first clearing all involved caches and then testing the search again. If the issue persists, you can test the same with the 'Dynamic CSS' option disabled from WP Admin -> Divi -> Theme Options -> General -> Performance.

I hope this helps and let me know how it goes.

regards,
Waqar

#2679149
Screenshot 2024-01-19 at 12-20-43 News Mental Health Association-(everything-disabled).png
Screenshot 2024-01-19 at 11-58-48 Page 2 Mental Health Association.png

That is the oddest thing I've seen. I tested other queries, even ones with multiple words, and they all seem to operate fine. I don't think it's necessarily a caching issue, because I'm having the same problem on a different staging environment (hidden link), and I encountered this breakage soon after migrating it to the Kinsta server with the intention of bringing it to production. Even so, clearing any and all caches doesn't appear to make a difference.

That said, when I disable Divi's Dynamic CSS toggle as you recommend, the page disregards the Theme Builder global header and footer areas specifically on this page (see attached), but in a different way.

[Edit:] so I did some testing and disabled everything besides Divi. The global Theme Builder header and footer areas work just fine until I activate Toolset Blocks (with everything disabled besides Divi, Toolset Types, and Toolset Blocks), so I don't think it's inherently a Divi issue (see attached image appended with "everything-disabled").

#2679507

This is very strange indeed.

During further testing, I've noticed that when the layout breaks, the page is being treated as a single post page, rather than the archive page.
( note the change in options in the 'Design with Toolset' header menu option. In a normal state, it shows the option "Edit Blog Posts Archive", but in a broken state it shows 'Edit Single Post Page Layout Template' )

I suspect the 'Relevanssi' plugin also has some effect on this since text search is overridden by Relevanssi when it is active. It would be interesting to test the same search with Relevanssi deactivated.

#2679705

Disabling Relevanssi doesn't appear to make a difference. I cleared the caches, too.

#2679808

Thank you for sharing this update.

Do I have your permission to download a fresh clone/snapshot of the website? This will help in investigating this, on a different server.

#2680636

Sorry for the delayed response. Yes, of course. Do what you need to do.

#2681036

Thank you for the permission and I've downloaded the website's clone.

Will do some deeper troubleshooting and get back to you, as soon as I can.

#2681050

I appreciate it.

#2681943

I was on a couple of days off but will resume investigation on this issue today.

#2682465

Appreciate the update.

#2682545

Thank you for waiting, as I completed the troubleshooting around this.

The way the header and footer are included through the Divi theme on this website, they're dependent on the query of the blog/posts page that is controlled by the theme and not by the Archive set by the Toolset.

That is why the header and footer are not included like the rest of the archive pages, when the blog page on its own (and not based on Toolset Archive's query) doesn't produce any results and is treated as a '404 - not found' page.

A quick temporary fix is to include the following custom CSS code in the assigned Toolset Archive so that when the layout breaks this way, the overlapping header elements are hidden:


#page-container > #top-header, #page-container > #main-header {
  display:none;
}

Note: The downside would be that when this happens the page will not have any header elements to interact with.

The more long-term and reliable fix would be to include the header and footer elements on the website in a more global way. This will ensure the layout and overall look remain the same across all pages of the website, including the '404 - not found' pages.

#2683442

It seems like this might be an edge case scenario that only breaks under very specific circumstances, making it difficult to fix. I understand if there's nothing more you can do to help me here. I appreciate your help in looking into this, however.

#2683546

Thank you for your understanding and you're welcome to mark this ticket as resolved.

Please feel free to start a new ticket for each new question or concern - we're here to help!