[Support request] Conflict with theme and adding header/footer code

Home Forums Support [Support request] Conflict with theme and adding header/footer code

Home Forums Support Conflict with theme and adding header/footer code

Viewing 15 posts - 1 through 15 (of 33 total)
  • Author
    Posts
  • #1268210
    Douglas

    Been having an issue for a while now that needs to be fixed. The problem exists when 2 plugins are installed on my site with the GeneratePress theme. While using a different theme (all other conditions the same), the plugins work properly. Hence, I know it’s a problem with the theme. And it’s happenning on new and old versions of the GP theme with the newest version of GP premium plugin.

    The problem: I use a membership plugin called Ultimate Member. Whenever I add code to my header or footer using either a code snippet plugin or manually adding the code, it causes an issue with Ultimate Member that does not allow customers to log into their account. I tried disabling and re-enabling all the plugins one by one to diagnose the issue and everything works fine with UM until I install code in my header. Then customers can’t login into their accounts. I remove the code, all works properly.

    This problem only occurs when using the Generate Press theme which is what I want to use for my site. When I switch the any other theme and add the same code to my header, everything works again.

    See here quick videos that demonstrate the issue. https://drive.google.com/open?id=1zQp6ELh-WbUGvhzQjaPrf3GEe26QikNA
    Tested with several themes all working except Generate Press which you can see in the video.

    #1268515
    David
    Staff
    Customer Support

    Hi there,

    what is the code and how are you adding it to your header ?

    #1269244
    Douglas

    I’ve tried several different snippets of code including tag manager, Google analytics and others. All produce the same issue. I’ve also tried adding the code several different ways and all produce the same issue. Tried over 10 GTM and header/footer injection plugins.

    #1269687
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    The videos don’t seem to be loading for me right now.

    Sounds strange. I assume the code is being added using standard WordPress hooks like wp_head and wp_footer. If so, the theme shouldn’t matter – those hooks aren’t aware of which theme you’re using.

    When you’re seeing the issue happen, are there any errors in your console?: Right-click + Inspect, then check the Console tab.

    Can you share some specific code that is causing the issue?

    #1269863
    Douglas

    There are no errors in the console. I’m updating the files in the Google Drive link so you can see the videos. Check the link above.

    As I mentioned, everything works when other themes are installed. For some reason when I switch to Generate Press and have tracking code in my header I get this issue.

    Can I email you access to my staging site to take a look?

    #1270131
    David
    Staff
    Customer Support

    You can send you Login details via the Account Issue form here:

    https://generatepress.com/contact/

    Please include the URL for this topic so we can track.

    #1270972
    Tom
    Lead Developer
    Lead Developer

    How exactly are you adding the code? Are you using a specific plugin?

    Have you checked with the Ultimate Member devs to see what could possibly cause the login to fail? It would help us debug.

    #1271425
    Douglas
    #1272468
    Tom
    Lead Developer
    Lead Developer

    What happens if you ditch the GTM plugins and use our instructions here?: https://docs.generatepress.com/article/implement-google-tag-manager/

    Just to confirm, the issue disappears completely once the GTM code isn’t active on the site?

    #1272485
    Douglas

    I’ll try this later today.

    Yes. Once the code is removed everything works as it should. However, I’ve tried different bits of code so it’s not Google Tag Manager specifically that’s causing the issue.

    #1272844
    Tom
    Lead Developer
    Lead Developer

    I am seeing some validation errors saying there is HTML in the <head> section of your website: https://validator.w3.org/

    It’s important that the <noscript><img .. /></noscript> elements in GTM (and Facebook pixels) are added in the wp_body_open hook, not wp_head.

    #1272894
    Douglas

    I turned off all plugins and am trying to install via the hook instructions you sent me (I have GP Premium). However, I get stuck at this step

    Under Settings tab, select wp_body_open in the Hook dropdown list and set the Priority to 0.

    In the dropdown under hook in settings, the option ‘wp_body_open’ is not presented.

    #1272932
    Tom
    Lead Developer
    Lead Developer

    Make sure you’re using the latest version of GP Premium (1.10.0).

    Alternatively, just use the functions at the bottom of the article.

    #1273046
    Douglas

    Should I just copy and paste these in with my own GTM # or is there other changes I need to make to the code?

    #1273057
    Tom
    Lead Developer
    Lead Developer

    I would replace the example code with the full code GTM gives you.

    I think it might be something else causing this issue, but it’s hard to tell because you have quite a few plugins activated, and there’s a lot of stuff in your <head> section, including a couple of different GTM codes.

    The first thing I would do (after adding your GTM functions) is make sure there is no HTML in the <head> section, which means removing any <noscript><img .. /></noscript> elements.

Viewing 15 posts - 1 through 15 (of 33 total)
  • You must be logged in to reply to this topic.