add readated in pages
This commit is contained in:
@@ -136,4 +136,22 @@ function modify_taxonomy_query($query) {
|
||||
|
||||
|
||||
|
||||
function custom_spravochniki_template($template) {
|
||||
if (is_singular('spravochniki') && has_term('pesticidy', 'spravochnik_category')) { // шаблон для пестицидов
|
||||
$custom_template = get_stylesheet_directory() . '/single-spravochniki-pesticidy.php';
|
||||
if (file_exists($custom_template)) {
|
||||
return $custom_template;
|
||||
}
|
||||
} elseif (is_singular('spravochniki') && has_term('agrochemicals', 'spravochnik_category')) { // шаблон для агрохимикатов
|
||||
$custom_template = get_stylesheet_directory() . '/single-spravochniki-agrochemicals.php';
|
||||
if (file_exists($custom_template)) {
|
||||
return $custom_template;
|
||||
}
|
||||
}
|
||||
return $template;
|
||||
}
|
||||
add_filter('template_include', 'custom_spravochniki_template');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user