bradfriedman
Forum Replies Created
-
Unfortunately (for reasons not worth explaining), I can’t currently do the search without the Loop Grid. In general, the whole design of the system is built around those Loop Grids (one in the main, left content section, and a smaller one for Recent Posts only in the right sidebar).
While we set Relevanssi to True in a Code Snippet, it was that that resulted in the return of blank search. That was alreadyh happening BEFORE we added that to try to fix it. But it didn’t.
With your latest advice, we tried to trap what was going on by turning on the debug logs, and here’s what was found (via Claude’s explanation, but I was the one who updated the snippets, turned on the debug, checked the log, told Claude what it said, etc.Relevanssi is producing a fatal error on search pages even with Co-Authors Plus deactivated:
Fatal error: get_object_vars(): Argument #1 must be of type object, string given in class-wp-post.php:266Full trace:_prime_post_caches() → get_post_type() → array_map() → WP_Query->get_posts()Relevanssi appears to be returning strings instead of post objects into the results array, causing WordPress to fatal when building the post cache. The
relevanssi=trueflag is set viaelementor/query/bb-main-loop. Co-Authors Plus was deactivated to rule it out — fatal persists either way.For the record, the mention of Co-authors there, is because, apparently there was some sort of reports of Relevanssi conflicting with co-authors in some way? To check that theory, I deactivated Co-Authors to run the Search again and it didn’t work with co-authors turned off either.
Stumped! 🙁Also, for the record, Claude has no idea if the results work unless I tell him, after pasting in his suggested code, running it, and telling him “Nope. Search results are still coming up blank.” So, no, there is no fabrication here. Just a frustrated journalist (BradBlog.com) trying to make my website work in the 21st Century! 🙁
I do understand. And, because I don’t “trust” Claude either. I don’t give it access to my pages etc. (via the Claude/Chrome thing). I use the Desktop version and do everything myself. He tells me what to put into a snippet, for example, and I copy and paste it in there myself. *I* am doing all of this. But with his assistance on stuff that I couldn’t do (eg. write the code!)
As a matter of fact, you had explained how that code into functions.php, but because I don’t want to make changes to that file (had a VERY bad, and YEARS long problem with not being able to update the system because of it — don’t get me started…) I explained that I don’t want to change functions.php, but he said we’d be able to do the same filter in a snippet. Which is where we left off on your suggestion for setting relevanssi setting to true, etc.
If you are unable or unwilling to help me because of that, as noted, I understand. I’m just trying to make search work properly on a 20+ year old database that was *finally* updated over this past week from wp 2.0.2 to the newest version. (Finally! Again, don’t ask why it took so long!) And, I guess because it’s such a large database now, searching with the tool I’m using (WP’s search with a News Kit Live Search widget in Elementor) is just horribly slow. Takes about 10 seconds for ANY search. It gives no progress indicator, and it doesn’t search two ACF fields I have for sub- and sub-sub-title, which really limits the Search all around and makes it feel like it’s not even working at all, given the time it takes. So, I’m looking for solutions, and the concensus was that relevanssi was the best option for my needs.Well, it IS me here. This is not actually an AI guessing machine. But tweaking PHP is above my skill level, so I turned to Claude to figure out why the out of the box setup, that seemed quite clear and straight forward (and highly recommended, btw!) wasn’t firing on my end. I did everything right, as far as I can tell. The page is loading, the “Search results for: ‘whatever'” is showing at the top of my Archive Search page, but the loop just isn’t showing up.
So, before bothering the developer, I thought Claude might be able to figure it out. We tried several snippets to make it fire (again, code for which is way above my skill level), so I asked Claude to explain what the problem was, what “he” had tried already, so it would be clearer to you.I’m happy to be in the middle of it, and answer any questions that I can. But, frankly, “he” knows more about the tech on this end, and what has been tried, etc., than I could ever really explain! 🙁
It’s why I asked for your forgiveness when I was sharing details from Claude. Wanted to make clear that it was not written by me, rather than trying to pull a fast one on ya. “He” is just better equipped to figure out what’s going wrong than I am, and when he couldn’t, it’s when I suggested we check in with the developer to see if you could spot anything we might be doing wrong on this end.
Brad
- This reply was modified 1 week, 4 days ago by bradfriedman.
(Replying, again with help of Claude! Forgive me! 🙂
Thanks for the quick reply! I tried your snippet with Query IDbb-main-loop:add_action( 'elementor/query/bb-main-loop', function( $query ) { $query->set( 'relevanssi', true ); } );The snippet runs without errors, but when Relevanssi is activated, Elementor doesn’t render the Loop Grid container at all on search pages — the main content area is completely blank. When Relevanssi is deactivated, the Loop Grid renders normally with results.
The Loop Grid widget uses “Current Query.” Could Relevanssi be hooking in too early and interfering with Elementor’s loop rendering before the Query ID action fires? Is there a way to tell Relevanssi not to touch the main query, and let the elementor/query hook handle it exclusively?