Skip to content

Commit

Permalink
🩹 Only prioritize block templates in block themes
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x committed Mar 30, 2024
1 parent cacfc23 commit 3b0df77
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/Roots/Acorn/Sage/Concerns/FiltersTemplates.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ trait FiltersTemplates
*/
public function filterTemplateHierarchy($files)
{
$templates = [...$this->sageFinder->locate($files), ...$files];

return ! current_theme_supports('block-templates')
? $templates
: array_reverse($templates);
return wp_is_block_theme() && current_theme_supports('block-templates')
? [...$files, ...$this->sageFinder->locate($files)]
: [...$this->sageFinder->locate($files), ...$files];
}

/**
Expand Down

0 comments on commit 3b0df77

Please sign in to comment.