add files inc

This commit is contained in:
Profile Profile
2026-03-09 20:51:08 +03:00
parent 83ca6c638a
commit ed4d79b706
23 changed files with 3728 additions and 4 deletions

20
inc/meta_keywords.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
add_action('wp_head', function() {
// Для записей и страниц
if (is_single() || is_page()) {
$post_id = get_queried_object_id();
// Получаем термины из таксономии 'keys'
$terms = get_the_terms($post_id, 'keys');
if ($terms && !is_wp_error($terms)) {
$keywords = array();
foreach ($terms as $term) {
$keywords[] = $term->name;
}
echo '<meta name="keywords" content="' . esc_attr(implode(', ', $keywords)) . '">' . "\n";
}
}
});