cOrrect mainnews in mobail

This commit is contained in:
2024-04-03 22:58:59 +03:00
parent 83eaa7246b
commit c6365d6263
4 changed files with 3557 additions and 6 deletions

View File

@@ -1,12 +1,13 @@
<?php get_header(); ?> <?php get_header(); ?>
<div class="content-middle articles-wrapper"> <div class="content-middle articles-wrapper">
<?php get_template_part('partials/pinned-post-mob'); ?> <?php include(get_template_directory().'/partials/pinned-post-mob.php');?>
<?php get_template_part('partials/rubrics-mobile'); ?> <?php get_template_part('partials/rubrics-mobile'); ?>
<div class="articles-preview"> <div class="articles-preview">
<?php <?php
$args = array( $args = array(
'post_type' => 'post', // Или ваш пользовательский тип постов, если необходимо 'post_type' => 'post', // Или ваш пользовательский тип постов, если необходимо
'post__not_in' => [ $mainpost_id ],
'posts_per_page' => 10, // Количество постов на странице 'posts_per_page' => 10, // Количество постов на странице
'cat' => [-17, -20, -21] 'cat' => [-17, -20, -21]
); );

3545
frontend/dist/assets/main.css vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -8,7 +8,7 @@
margin-left: -1px; margin-left: -1px;
} }
.main-title-mob{ .maintitle-mob{
display: none; display: none;
font-weight: bold; font-weight: bold;
color: #006842; color: #006842;
@@ -135,7 +135,7 @@
display: block; display: block;
} }
.main-title-mob{ .maintitle-mob{
display: block; display: block;
} }

View File

@@ -8,11 +8,15 @@ $last_sticky_post_id = end($sticky_posts);
// Получаем объект поста по его идентификатору // Получаем объект поста по его идентификатору
$pinned_post = get_post($last_sticky_post_id); $pinned_post = get_post($last_sticky_post_id);
if ($pinned_post):?> if ($pinned_post):
$mainpost_id = $pinned_post->ID;
?>
<div сlass="main-title-mob" style="font-weight: bold; color: #006842; margin: 12px 0 12px 0;">Главное</div> <div class="maintitle-mob">Главное</div>
<div class="article-item__text article-item-mob"> <div class="article-item__text article-item-mob">
<a href="<?php echo get_permalink($pinned_post->ID); ?>" class="article-item__image-container"> <a href="<?php echo get_permalink($pinned_post->ID); ?>" class="article-item__image-container">
<?=show_post_image( $pinned_post->ID ); ?> <?=show_post_image( $pinned_post->ID ); ?>
<div class="tag article-item__tag"><?=esc_html(get_category_name($pinned_post));?></div> <div class="tag article-item__tag"><?=esc_html(get_category_name($pinned_post));?></div>
@@ -21,6 +25,7 @@ if ($pinned_post):?>
<a href="<?php echo get_permalink($pinned_post->ID); ?>" class="subtitle-16 article-item__link"><?php echo get_the_title($pinned_post->ID); ?></a> <a href="<?php echo get_permalink($pinned_post->ID); ?>" class="subtitle-16 article-item__link"><?php echo get_the_title($pinned_post->ID); ?></a>
<p class="article-item__descr text-13"><?php echo get_the_excerpt($pinned_post->ID); ?></p> <p class="article-item__descr text-13"><?php echo get_the_excerpt($pinned_post->ID); ?></p>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>