Home › Forums › Support › LearnDash error in “Account”, only happens when GeneratePress theme is active
- This topic has 25 replies, 3 voices, and was last updated 6 months, 4 weeks ago by David.
October 25, 2022 at 3:02 am #2385172DavidStaffCustomer Support
What happens if you disable the Child Theme ? So its just the GP parent theme ?October 25, 2022 at 12:09 pm #2386094eraserheader
When I turn off the child theme on the Live site, the problem is resolved. So it must be that.
I’m not sure, though, why this isn’t happening on the Testing site, which also has the child theme. I do know that there have been more updates on Live plugin wise than on testing.
So, what is our next step in terms of resolving that the Child theme generates the error but Parent does not over on Live? Our hosting isn’t one that we can consolidate between Live and Testing. Ideally, we’d resolve this issue on the live site, then pull THAT over as new Testing moving forward. Too much content changes have been made on Live to push over Testing to the public.October 25, 2022 at 2:24 pm #2386312YingStaffCustomer Support
If the testing site is working well with the child theme activated, then compare the 2 child themes, are there any differences?October 28, 2022 at 6:51 am #2391451eraserheader
Is there a way to compare 2 child themes effectively without ‘go through every page and see what’s different’?October 28, 2022 at 7:08 am #2391493DavidStaffCustomer Support
The issue will most likely stem from the Child Themes functions.php – if you can provide a new admin access login then i can take a look for any code that may be relevant to this issue.October 28, 2022 at 7:17 am #2391505eraserheader
From our host:
“Re: Generatepress; we did compare the live/test Child themes – no difference in the functions.php and styles.css.
Is it possible to move the functions.php code from the child theme over to a Code Snippets plugin (we can help with this) and then we can toggle things off and on to determine if one of those is causing the problem?”
Is this something you advise? Else, credentials for you have been provided below.October 28, 2022 at 7:56 am #2391790DavidStaffCustomer Support
Nothing jumps out as being an issue. The Code Snippets idea sounds like a good option. Or you can simply add a
/*before each snippet and a
*/after each on to comment them out. They’ll turn orange in the editor.October 28, 2022 at 8:10 am #2391812eraserheader
But the issue remains.
We might just have to bit the bullet and get rid of child all together. The hosting company will also proceed with waht was mentioned above. I will update!October 29, 2022 at 3:38 am #2392515DavidStaffCustomer Support
Let us know how you get on.November 1, 2022 at 6:29 am #2396711eraserheader
But not how we thought. From the hosting company:
“This issue should now be resolved. It turns out it is reproducible on the test subdomain (or was) and so we were able to fiddle over there.
The issue, at its core, appears to be a LearnDash code issue, however it was presented/came about by the change to remove courses from search results.
There’s a standard method for specifying what post types show up in search results, which is what we used to make that happen. This method hooks into every single wp_query on the site, then checks to see if the query ‘is_search’ before then limiting the results by the post types specified.
However for reasons totally unknown to me (I see no reason why it should be necessary), LearnDash’s wp_query to retrieve those courses for the Account page is setting itself as a search (which IMO is the bug), so it was returning ‘yes I’m a search!’ to anything trying to interact with it. Because of this, the search filtering we implemented was removing courses from that page.
I’ve put a workaround in place that ignores the account page for that hook (that limits the search results). However if there are other areas in which LearnDash classifies their wp_queries as searches, courses will have disappeared from those areas as well (and will still not show).
This code is at the bottom of the functions.php file in the child theme. I’d recommend sending it to LearnDash support, indicate that aside from my workaround (the is_page part), this is a standard search modifier for WordPress, and ask why they’re calling their wp_query a search when it’s not really a search in that a user hasn’t explicitly entered search terms to get results.
If we can get them to change their code so it’s not considered a search on that page and anywhere else they might have misclassified their wp_query, then we can both:
1. Go back to the original code, and
2. Be sure that this isn’t causing issues elsewhere on the site
“November 1, 2022 at 6:44 am #2396740DavidStaffCustomer Support
Oh wow – well done to you guys for debugging that.
It makes sense now why that would break it… but i am surprised that LearnDash would hijack the search wp_query.
Glad to hear you got to the bottom of it.
If you hear from LearnDash as to why – i would like to know as i am sure this is not the only time it would come up 🙂
- You must be logged in to reply to this topic.