correct micro newsArcticle
This commit is contained in:
@@ -1,17 +1,22 @@
|
|||||||
<!--[micro/post]-->
|
|
||||||
|
|
||||||
<link itemprop="mainEntityOfPage" href="<?= get_permalink(); ?>"/>
|
<link itemprop="mainEntityOfPage" href="<?= get_permalink(); ?>"/>
|
||||||
|
|
||||||
<meta itemprop="inLanguage" content="ru"/>
|
<meta itemprop="inLanguage" content="ru"/>
|
||||||
|
|
||||||
<meta itemprop="headline name" content="<?= htmlspecialchars( get_the_title() ) ?>" />
|
|
||||||
|
|
||||||
<meta itemprop="dateModified" content="<?= the_modified_date("c"); ?>"/>
|
<meta itemprop="dateModified" content="<?= the_modified_date("c"); ?>"/>
|
||||||
|
|
||||||
|
<?php // Получаем текущие рубрики поста
|
||||||
|
$categories = get_the_category();
|
||||||
|
if (!empty($categories)) {
|
||||||
|
// Берём первую рубрику (можно изменить логику при необходимости)
|
||||||
|
$current_category = $categories[0]->name;
|
||||||
|
$microcategory = $categories[0]->name;
|
||||||
|
|
||||||
|
} elseif ( in_array( get_post_type(), ["anew", "yellow"] ) && !is_tag() && !is_category() ){
|
||||||
|
$microcategory = 'Новости';
|
||||||
|
}
|
||||||
|
echo '<meta itemprop="articleSection" content="' . $microcategory . '">';
|
||||||
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
get_template_part("template-parts/micro/terms");
|
//get_template_part("template-parts/micro/terms");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!--[/micro/post]-->
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<div class="d-none">
|
<div class="d-none">
|
||||||
|
|
||||||
<?php foreach (wp_get_post_terms( get_the_ID(), ["category", "post_tag"] ) as $term) : ?>
|
<?php foreach (wp_get_post_terms( get_the_ID(), ["category"] ) as $term) : ?>
|
||||||
|
|
||||||
<span itemprop="articleSection">
|
<span itemprop="articleSection">
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<?php get_template_part("template-parts/micro/post"); ?>
|
<?php get_template_part("template-parts/micro/post"); ?>
|
||||||
|
|
||||||
<h1 class="profile_onenews__title">
|
<h1 class="profile_onenews__title" itemprop="headline">
|
||||||
|
|
||||||
<?= the_title() ?>
|
<?= the_title() ?>
|
||||||
|
|
||||||
@@ -48,7 +48,8 @@
|
|||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<div class="micromarking">
|
|
||||||
|
<div itemprop="articleBody" class="micromarking">
|
||||||
|
|
||||||
<?= the_content() ?>
|
<?= the_content() ?>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user