add fix problem
This commit is contained in:
35
blocks/mainnews.php
Normal file
35
blocks/mainnews.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
$params = array(
|
||||
'posts_per_page' => -1, // нужно для отображения всех постов, без разделения по страницам
|
||||
'post__in' => get_option( 'sticky_posts' ),
|
||||
'posts_per_page' => 1
|
||||
);
|
||||
|
||||
$q = new WP_Query( $params );
|
||||
|
||||
if ( $q->have_posts() ) :
|
||||
$q->the_post();
|
||||
$mainpost_id = get_the_ID();
|
||||
?>
|
||||
|
||||
<div class="main-card">
|
||||
|
||||
<?if ( has_post_thumbnail() ) :?>
|
||||
<div class="card-img-top">
|
||||
<a href="<?the_permalink();?>"><img src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" alt="<?the_title();?>"></a>
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
<h2 class="main-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
|
||||
<div class="main-card-body">
|
||||
<div class="main-card-text"><a href="<?the_permalink();?>"><?the_excerpt();?></a></div>
|
||||
<div class="news_date"><?the_time('j F Y, G:i');?></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<?php endif; wp_reset_postdata();
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
$posts = get_posts( array(
|
||||
'numberposts' => 4,
|
||||
'category' => 22, // пока тольео события
|
||||
'category' => 2, // пока тольео события
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
'include' => array(),
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
$mosts = get_posts( array(
|
||||
'numberposts' => 3,
|
||||
'category' => 22, // пока без категории
|
||||
'category' => 2, // пока без категории
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
'include' => array(),
|
||||
|
||||
@@ -5,7 +5,7 @@ $key = 'vij_opinions';
|
||||
if (!$opinions = kuri_set($key)) {
|
||||
$opinions = get_posts( array(
|
||||
'numberposts' => 1,
|
||||
'category' => 30, // 7 - мнения
|
||||
'category' => 8, // 7 - мнения
|
||||
'orderby' => 'date',
|
||||
'order' => 'DESC',
|
||||
'include' => array(),
|
||||
@@ -25,8 +25,8 @@ if(is_array($opinions)):
|
||||
$post = $opinions[0];?>
|
||||
|
||||
<div class="left_opinion<?if ($args['subclass'] !== '') echo ' '.$args['subclass'];?>">
|
||||
<div class="left_opinion_title">мнение</div>
|
||||
<img class="left_preview" src="<?php echo get_the_post_thumbnail_url($post, 'left-thumb');?>" alt="<?=$post->post_title;?>">
|
||||
<div class="left_opinion_title"><a href="https://vetandlife.ru/category/mneniya/">мнение</a></div>
|
||||
<img class="left_preview" src="<?php echo get_the_post_thumbnail_url($post, 'fill');?>" alt="<?=$post->post_title;?>">
|
||||
<div class="left_opinion_text"><a href="<?=get_permalink($post);?>"><?=$post->post_title;?></a></div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user