[Resolved] LearnDash error in “Account”, only happens when GeneratePress theme is active

Home Forums Support [Resolved] LearnDash error in “Account”, only happens when GeneratePress theme is active

Home Forums Support LearnDash error in “Account”, only happens when GeneratePress theme is active

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • #2385172
    David
    Staff
    Customer Support

    What happens if you disable the Child Theme ? So its just the GP parent theme ?

    #2386094
    eraserheader

    Aha!

    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.

    #2386312
    Ying
    Staff
    Customer Support

    If the testing site is working well with the child theme activated, then compare the 2 child themes, are there any differences?

    #2391451
    eraserheader

    Is there a way to compare 2 child themes effectively without ‘go through every page and see what’s different’?

    #2391493
    David
    Staff
    Customer 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.

    #2391505
    eraserheader

    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.

    #2391790
    David
    Staff
    Customer 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.

    #2391812
    eraserheader

    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!

    #2392515
    David
    Staff
    Customer Support

    Let us know how you get on.

    #2396711
    eraserheader

    SOLVED!

    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

    #2396740
    David
    Staff
    Customer 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 🙂

Viewing 11 posts - 16 through 26 (of 26 total)
  • You must be logged in to reply to this topic.