correct logic rfo
This commit is contained in:
@@ -39,7 +39,7 @@ add_filter('single_template', function($template) {
|
||||
: $category;
|
||||
|
||||
// Если рубрика в списке целевых
|
||||
if (in_array($parent_category->slug, $target_parent_slugs)) {
|
||||
if (in_array($parent_category->slug, $target_parent_slugs)) {
|
||||
// Ищем шаблон single-{родительская-рубрика}.php
|
||||
$new_template = locate_template("single-{$parent_category->slug}.php");
|
||||
if ($new_template) return $new_template;
|
||||
|
||||
Reference in New Issue
Block a user