add adv partials

This commit is contained in:
argoexpert press
2024-05-22 21:18:03 +03:00
parent 097eefe379
commit 4fa7a19433
7 changed files with 90 additions and 7 deletions

24
category-en.php Normal file
View File

@@ -0,0 +1,24 @@
<?php get_header( 'en' ); ?>
<div class="content-middle articles-wrapper">
<?php include(get_template_directory().'/partials/pinned-post-mob.php');?>
<?php get_template_part('partials/rubrics-mobile'); ?>
<div class="articles-preview">
<?php
$args = array(
'post_type' => 'post', // Или ваш пользовательский тип постов, если необходимо
'post__not_in' => [ $mainpost_id ],
'posts_per_page' => 10, // Количество постов на странице
'orderby' => 'date', // сортировка по дате
'order' => 'DESC', // по убыванию (сначала новые)
'ignore_sticky_posts' => 1,
'cat' => get_expression_en()
);
$query = new WP_Query($args);
?>
<?php get_template_part('partials/post-list', null, ['large_first_image' => false, 'query' => $query]); ?>
</div>
<button class="articles-preview__show-next">More Read</button>
</div>
<?php get_footer( 'en' ); ?>

42
category-partners-en.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
$partners = new WP_Query([
'category_name' => 'partners-en',
'post_type' => 'post',
'posts_per_page' => 10,
'orderby' => 'date',
'order' => 'ASC'
]);
?>
<?php get_header( 'en' ); ?>
<div class="content-middle articles-wrapper">
<?php get_template_part('partials/rubrics-mobile'); ?>
<div class="section-title">
<h1 class="section-title__title"><?= get_queried_object()->name ?></h1>
</div>
<div class="articles-preview">
<?
if ($partners->have_posts()) :
while ($partners->have_posts()) :
$partners->the_post();
?>
<a href="<?= get_permalink(); ?>" class="partner-item">
<div>
<?if ( has_post_thumbnail() ) {
the_post_thumbnail( 'thumbnail' ); // Это выведет самую маленькую превьюшку
}?>
</div>
<div class="partner-item__text-container">
<p class="subtitle-16"><?= get_the_title(); ?></p>
</div>
</a>
<?php
endwhile;
endif;
?>
</div>
<? custom_pagination($partners); ?>
</div>
<?php
get_footer( 'en' ); ?>

View File

@@ -14,10 +14,10 @@
<div class="footer-top__inner">
<?php $site_logo = get_field('site_logo', 'option'); ?>
<a href="<?php echo home_url(); ?>" class="logo footer__logo">
<img src="<?php echo esc_url($site_logo); ?>" alt="" />
<img src="https://agroexpert.press/wp-content/uploads/2024/05/agroexpert_horizontally.svg" alt="agroexpert.press" width="145" />
</a>
<nav class="nav footer__nav">
<?php get_template_part('partials/menu-primary'); ?>
<?php get_template_part('partials/mainmenu-en'); ?>
</nav>
<div class="footer-top__right">
<a href="#" class="to-top">

View File

@@ -59,7 +59,7 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<img src="https://agroexpert.press/wp-content/uploads/2024/05/agroexpert_horizontally.svg" alt="agroexpert.press" width="188" />
</a>
<nav class="nav header__nav">
<?php get_template_part('partials/menu-primary'); ?>
<?php get_template_part('partials/mainmenu-en'); ?>
</nav>
<div class="header__right">
<div class="header__actions">

View File

@@ -1,8 +1,5 @@
<?php
$menu_location = 'primary';
$locations = get_nav_menu_locations();
$menu_id = $locations[$menu_location];
$menu_id = 761;
$menu_items = wp_get_nav_menu_items($menu_id);
?>
<?php foreach ($menu_items ?: [] as $menu_item):?>

10
partials/rtb-floor.php Executable file
View File

@@ -0,0 +1,10 @@
<!-- Yandex.RTB R-A-7761284-1 -->
<script>
window.yaContextCb.push(()=>{
Ya.Context.AdvManager.render({
"blockId": "R-A-7761284-1",
"type": "floorAd",
"platform": "touch"
})
})
</script>

10
partials/rtb-single.php Executable file
View File

@@ -0,0 +1,10 @@
<!-- Yandex.RTB R-A-7761284-2 -->
<div id="yandex_rtb_R-A-7761284-2"></div>
<script>
window.yaContextCb.push(()=>{
Ya.Context.AdvManager.render({
"blockId": "R-A-7761284-2",
"renderTo": "yandex_rtb_R-A-7761284-2"
})
})
</script>