Support » Plugin: SES Theme Split Test » SES Theme Split Test 1.4 upgrade breaks get_template_directory

  • I upgraded SES Theme Split Test to the new version (1.4), and my site instantly went down with fatal errors describing calls to undefined functions.

    I tracked the problem to a couple of includes in my functions file like the following:
    require( get_template_directory() . '/widgets/widgets.php' );

    The includes weren’t successful, so the functions didn’t get defined.

    In order to clear the problem, I had to change get_template_directory() to get_stylesheet_directory(), which does seem to work.

    http://wordpress.org/plugins/wordpress-ab-theme-split-tests/

Viewing 5 replies - 1 through 5 (of 5 total)
  • I thought I had this fixed, and it’s working in Chrome on my mac, but IE still gives me include errors, like so:

    Warning: require(/serverpath/wp-content/themes/1/widgets/widgets.php): failed to open stream: No such file or directory in /serverpath/wp-content/themes/holland/functions.php on line 382

    The require() path is not resolving properly with the new version of the plugin and WP 3.6.1. Instead of the “holland” directory, it’s looking for a “1” directory.

    It looks like whether I use get_template_directory() or get_stylesheet_directory() the plugin is replacing the theme name with “0” or “1” depending on which theme is selected.

    Plugin Author Lee Willis

    (@leewillis77)

    Hi,

    None of the code you’ve posted has anything to do with this plugin – looks like it’s all coming from your theme?

    Hello Lee, thanks for replying.

    You’re right that the problem is in an interaction between my theme’s code and the plugin, but I haven’t been able to figure out how to correct it.

    The issue is that when I require a file in my theme, like so:

    require( 'widgets/widgets.php' );

    the include path would be relative to my theme, like so:

    /serverpath/wp-content/themes/holland/widgets/widgets.php

    but when I enable the plugin, the include path is rewritten like so:

    /serverpath/wp-content/themes/1/widgets/widgets.php

    and my site breaks. When I turn off the plugin, the include path reverts to its original, correct version and the site works again.

    Plugin Author Lee Willis

    (@leewillis77)

    Can you try going into the settings for the theme split test plugin (The newer version), and re-saving your choice of available themes.

    Thanks Lee, I will try it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘SES Theme Split Test 1.4 upgrade breaks get_template_directory’ is closed to new replies.