Skip to content

Commit

Permalink
Revert moving template files into a theme subfolder
Browse files Browse the repository at this point in the history
Having template files in a subfolder can lead to unexpected consequences, as we can see in timber/timber#2458. There may be other effects. Working around them is more tedious than the benefits a subfolder brings.
  • Loading branch information
gchtr committed Mar 14, 2023
1 parent b1946c5 commit 1823e4d
Show file tree
Hide file tree
Showing 14 changed files with 3 additions and 3 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions theme/functions.php → functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* to load your dependencies and initialize Timber. If you are using Timber via the WordPress.org
* plug-in, you can safely delete this block.
*/
$composer_autoload = dirname( __DIR__ ) . '/vendor/autoload.php';
$composer_autoload = __DIR__ . '/vendor/autoload.php';
if ( file_exists( $composer_autoload ) ) {
require_once $composer_autoload;
Timber\Timber::init();
Expand All @@ -35,7 +35,7 @@ function() {
add_filter(
'template_include',
function( $template ) {
return dirname( get_stylesheet_directory() ) . '/static/no-timber.html';
return get_stylesheet_directory() . '/static/no-timber.html';
}
);
return;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/test-timber-starter-theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class TestTimberStarterTheme extends \WorDBless\BaseTestCase {
function setUp() {
self::_setupStarterTheme();
switch_theme( basename( dirname( __DIR__ ) ) . '/theme' );
require_once dirname( __DIR__ ) . '/theme/functions.php';
require_once dirname( __DIR__ ) . '/functions.php';
// WorDBless includes wp-settings.php
do_action( 'after_setup_theme' );
}
Expand Down

0 comments on commit 1823e4d

Please sign in to comment.