add vystavki
This commit is contained in:
@@ -36,6 +36,24 @@ function mob_block($template){
|
||||
}
|
||||
|
||||
|
||||
//свой шаблон для категории
|
||||
add_filter( 'single_template', function ( $single_template ) {
|
||||
|
||||
|
||||
foreach( (array) get_the_category() as $cat ) {
|
||||
|
||||
if ( file_exists(TEMPLATEPATH . "/single-{$cat->slug}.php") )
|
||||
return TEMPLATEPATH . "/single-{$cat->slug}.php";
|
||||
|
||||
}
|
||||
|
||||
return $single_template;
|
||||
|
||||
|
||||
}, PHP_INT_MAX, 2 );
|
||||
|
||||
|
||||
|
||||
function kuri_set($name = null, $value = null) {
|
||||
|
||||
static $vars = array();
|
||||
|
||||
Reference in New Issue
Block a user