add beta rfo
This commit is contained in:
17
rfo/breadcrumbs-rfo.php
Normal file
17
rfo/breadcrumbs-rfo.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
$current_category_id = get_queried_object_id(); // ID текущей категории
|
||||
$category_url = get_category_link($current_category_id);
|
||||
|
||||
?>
|
||||
|
||||
<ul class="breadcrumbs__rfo">
|
||||
<li class="breadcrumbs-home__rfo">
|
||||
<span><a href="<?=home_url()?>/rfo">Главная</a></span>
|
||||
<span class="breadcrumbs-arrow">
|
||||
<svg width="6" height="18" viewBox="0 0 6 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1.5 12.75L5.25 9L1.5 5.25" stroke="#4F4F4F" stroke-linecap="round" stroke-linejoin="round" />
|
||||
</svg>
|
||||
</span>
|
||||
</li>
|
||||
<li><a href="<?=$category_url?>"><?=get_category_name();?></a></li>
|
||||
</ul>
|
||||
8
rfo/logoline.php
Normal file
8
rfo/logoline.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="header-rfo-logoline">
|
||||
<img src="https://agroexpert.press/wp-content/themes/agroexpert/frontend/img/rfo-logo.svg" >
|
||||
<div class="agroexpess-logo">
|
||||
<?php $site_logo = get_field('site_logo', 'option');?>
|
||||
<a href="<?php echo home_url(); ?>" class="logo header__logo">
|
||||
<img src="<?php echo esc_url($site_logo); ?>" width="158" alt="" />
|
||||
</a>
|
||||
</div>
|
||||
18
rfo/menu-rfo.php
Normal file
18
rfo/menu-rfo.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
$menu_name = 'rfo-main'; // Название меню в админке
|
||||
$menu = wp_get_nav_menu_object($menu_name); // Получаем объект меню
|
||||
|
||||
if ($menu) {
|
||||
$menu_items = wp_get_nav_menu_items($menu->term_id); // Получаем элементы меню
|
||||
|
||||
foreach ($menu_items ?: [] as $menu_item) {
|
||||
?>
|
||||
<li class="menu-item">
|
||||
<a href="<?= esc_url($menu_item->url); ?>">
|
||||
<?= esc_html($menu_item->title) ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
22
rfo/post-list.php
Normal file
22
rfo/post-list.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
global $wp_query;
|
||||
$large_first_image = $args['large_first_image'] ?? true;
|
||||
$post_counter = 0;
|
||||
$query = $args['query'] ?? $wp_query;
|
||||
if ($query->have_posts()) {
|
||||
while ($query->have_posts()) {
|
||||
$post_counter++;
|
||||
$end = $query->post_count;
|
||||
$query->the_post();
|
||||
|
||||
if ( $post_counter == 1 ) :
|
||||
get_template_part('content', 'post-main-rfo', ['full_width' => $post_count === 1 ]);
|
||||
elseif ( $post_counter == 2) :
|
||||
get_template_part('content', 'post-rfo', ['full_width' => $post_count === 1 && $large_first_image]);
|
||||
else:?>
|
||||
<?get_template_part('content', 'post-rfo', ['full_width' => false]);?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?wp_reset_postdata();
|
||||
}
|
||||
}?>
|
||||
@@ -17,7 +17,7 @@ if ($categories) {
|
||||
$related_posts_query = new WP_Query($args);
|
||||
|
||||
if ($related_posts_query->have_posts()) {
|
||||
|
||||
echo '<div class="related-posts">';
|
||||
echo '<div class="article-section-title__rfo">Читайте также:</div>';
|
||||
echo '<div class="articles-preview-rfo">';
|
||||
|
||||
@@ -26,6 +26,7 @@ if ($categories) {
|
||||
get_template_part('content', 'post-rfo');
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
wp_reset_postdata();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user