• I have recently installed a new CMS-style theme for WordPress — http://carringtontheme.com/. This theme is different from any I have used before, in that it does not use the default template files — header.php, footer.php, page.php, etc — in the normal way.

    In each template file it has only a couple lines of php code and this note:
    // NOTE: this file is here for compatibility reasons – active templates are in the footer/ dir

    I have been using google-analytics-for-wordpress plugin v2.9.3 for some time with good results. However, changing to Carrington theme creates a problem.

    I get an error with plugin because footer.php does not call wp_footer. I see the error and I see the fix posted on the plugin site.

    However, as Carrington theme does not use footer.php I think it also does not use wp_footer. Adding wp_footer call to footer.php may not be effective or may cause add’l problem. So I am unclear on what to do.

    I can see the GA code on some pages, but I am unable to check every page and I do not know how to tell if there are errors or broken functions that may not be immediately visible to me.

    My question is whether I should stop using plugin and enter GA code manually into theme templates, ignore the error and hope it works anyway, or is there some fix or change for plugin that gets around the wp_footer requirement?

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • In your shoes, I’d consider changing themes. A theme that doesn’t use wp_head() and/or wp_footer() is likely to create some real plugin headaches for you. Both of those functions are used by plugin developers as hooks to add their content to generated pages.

    Thread Starter terrywfrazier

    (@terrywfrazier)

    Changing themes is certainly one way to address the problem, but the Carrington theme set allows me some functionality that I have not found in most other themes – e.g. the ability to have a “static” home page, different templates per category or post, etc.

    So far the other plug-ins I use appear to function normally, so I would probably look at managing GA code manually as the more attractive option for me. But I would be happier if there were a workaround with this plugin, as it also has some good functionality.

    Carrington does use wp_footer() function. Check the file in footer/footer-default.php…Unless you define your custom footer, I don’t see a reason why it does not load wp_footer() mentioned in footer-default.php.

    Thread Starter terrywfrazier

    (@terrywfrazier)

    The Admin at Crowd Favorite (author of Carrington) posted this explanation of the problem <http://bit.ly/S5Y96&gt;.

    So you are correct that Carrington does use wp_footer. I will see if my webmaster has defined custom footer. It is also possible the error may be due to location in a different directory than the plugin expects.

    I will look to see before posting further.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘[Plugin: Google Analytics for WordPress] What to do if theme does not use footer.php’ is closed to new replies.