• Hi everyone.

    I’m attempting to add some code to our WP site for Google Ads conversion tracking.

    I just need to add a code snippet before the closing body tag </body>

    However, I am unable to do this.

    I have edited the header.php file for my theme, but the change doesn’t take effect. My change is not reflected in the page source.

    I have edited that file manually and uploaded it via php. No effect, my change is not reflected in the page source code.

    I have used the WP Theme Editor to edit the file. No effect, my change is not reflected in the page source code.

    It’s as if the site contents is cached, but I know there are no cache plugins. The site was using WP-Optimized but I uninstalled it. And I did clear the WP-O cache.

    I have cleared my Google Chrome cache many times.

    I have confirmed that I am working with the correct set of files on my localhost machine.

    I have tried multiple browsers.

    I have made sure the wp-content > cache directory is empty.

    I’m currently running the site on localhost so I know there’s no CDN involved.

    And since I’m working locally, there’s no web host or third party cache involved (like nginx or sucuri).

    I tried renaming the “themes” directory to “themesBU” and the site still renders properly.

    I also tried changing the directory names of every directory in “themes” and the site still servers and renders properly.

    So I am completely stumped. With all the changes noted above I would expect the theme to break and the pages to either fail to load or load with an improper look/layout.

    Here’s some details:

    – WordPress 5.6
    – Theme is storefront by automattic
    – We are using Woocommerce
    – Editor is Brizy

    Anyone have advice?

Viewing 6 replies - 1 through 6 (of 6 total)
  • First, you edited header.php to put something at the bottom of the page?
    Ads don’t usually work on localhost since Google can’t get there to verify it’s your site.

    As for the renaming of folders without affecting the site, you should examine everything about your configuration to see if it’s really pointing at the folder you think it is. Obviously, renaming themes should affect the site.

    Thread Starter wordpresspros

    (@wordpresspros)

    Sorry about that. I should have said I wanted the snippet just above the closing head tag </head>.

    I known Ads won’t work on localhost. I’m just using localhost to troubleshoot the issue of adding the code snippet.

    As for my configuration, I know I am working with the correct set of files as I mentioned:

    “I have confirmed that I am working with the correct set of files on my localhost machine.”

    If you use the admin interface to install a theme or plugin, do you see the corresponding folder change as expected?
    Are you using Docker or something that has virtual hosts or using virtualization software?
    Does the Settings > General > Site URL and WP URL match your setup for the localhost?

    Thread Starter wordpresspros

    (@wordpresspros)

    Hi Joy. Thanks so much for offering some advice.

    I am so confused by all this!

    Here’s my responses to your questions:

    If you use the admin interface to install a theme or plugin, do you see the corresponding folder change as expected?
    Yes

    Are you using Docker or something that has virtual hosts or using virtualization software?
    No, nothing like that at all.

    Does the Settings > General > Site URL and WP URL match your setup for the localhost?
    Yes, here is what is shown in the “Site Address (URL) field:
    https://mysite.local.mylive
    And this is what I use to access the front-end of the site:
    https://mysite.local.mylive/

    I really am dumbfounded. It’s as if the site is being served from a completely different server. But I know, for example, that if I rename the local directory on my computer from which wamp servers the site, the site breaks.

    Right now the site servers out of a directory called “MySite” and then a directory called “live.” If I rename “live” to “livebu” that breaks the site.

    So I know I’m working with the right set of files.

    I also tried renaming MySite > live > wpcontent to MySite > live > wpcontentBU

    and that broke the site too.

    So now here’s the mysterious part.

    If I then rename MySite > live > wpcontent > themes to MySite > live > wpcontent > themesBU the site still servers properly!

    We are using Woocommerce with the Storefront theme. Could that mean that the theme files are someplace other than in wpcontent?

    Hmmmm…maybe it’s a woocommerce template that isn’t in wpcontent > themes?

    Thread Starter wordpresspros

    (@wordpresspros)

    I also tried changing the theme to Twenty Seventeen via Appearance > Themes. My theme doesn’t change on the front end?

    Thread Starter wordpresspros

    (@wordpresspros)

    Looks like this may be a template supplied by the Brizy Editor. So I believe I need to find where to make the edits to a brizy template.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Adding AdWords Conversion Tracking – Weird Template Issues’ is closed to new replies.