add fix problem
This commit is contained in:
70
index.php
70
index.php
@@ -7,11 +7,19 @@
|
||||
get_header();
|
||||
$nn = 0;?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="content">
|
||||
|
||||
<h1 id="mainpage-title">Главное</h1>
|
||||
|
||||
<?include(get_template_directory().'/blocks/mainnews.php');?>
|
||||
|
||||
<?php $query = new WP_Query(
|
||||
array(
|
||||
'category__in' => array(2),
|
||||
'post__not_in' => array($mainpost_id),
|
||||
'meta_query' => array(
|
||||
array(
|
||||
'key' => '_thumbnail_id',
|
||||
@@ -22,54 +30,30 @@ $nn = 0;?>
|
||||
); # фильтруем рубрики
|
||||
?>
|
||||
|
||||
<div id="content">
|
||||
<?php if($query->have_posts()) : ?>
|
||||
|
||||
|
||||
<h1 id="mainpage-title">Главное</h1>
|
||||
<div class="mini-card-block">
|
||||
|
||||
<?php if($query->have_posts()) : while($query->have_posts()) : $query->the_post();?>
|
||||
<?php while($query->have_posts()) : $query->the_post();?>
|
||||
|
||||
<?$nn++;?>
|
||||
|
||||
<?if ($nn == 1):?>
|
||||
|
||||
<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>
|
||||
|
||||
<?elseif ($nn == 2):?>
|
||||
<div class="mini-card-block">
|
||||
<?endif?>
|
||||
|
||||
<?if ($nn > 1):?>
|
||||
|
||||
<div class="mini-card">
|
||||
<?if ( has_post_thumbnail() ) :?>
|
||||
<div class="mini-card-img">
|
||||
<a href="<?the_permalink();?>"><img class="mini-card-img" src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" alt="<?the_title();?>"></a>
|
||||
|
||||
<div class="mini-card">
|
||||
<?if ( has_post_thumbnail() ) :?>
|
||||
<div class="mini-card-img">
|
||||
<a href="<?the_permalink();?>"><img class="mini-card-img" src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" alt="<?the_title();?>"></a>
|
||||
</div>
|
||||
<?endif?>
|
||||
<h2 class="mini-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
|
||||
<div class="mini-card-body">
|
||||
<div class="news_date"><?the_time('j F Y, G:i');?></div>
|
||||
</div>
|
||||
<?endif?>
|
||||
<h2 class="mini-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
|
||||
<div class="mini-card-body">
|
||||
<div class="news_date"><?the_time('j F Y, G:i');?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?endif?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php endwhile;?>
|
||||
|
||||
</div> <!--//end minicard block -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@@ -81,6 +65,8 @@ $nn = 0;?>
|
||||
<?get_template_part( '/blocks/citata', null, ['subclass' => 'mob-lite']);?>
|
||||
<?get_template_part( '/blocks/mosts', null, ['subclass' => 'mob-lite']);?>
|
||||
|
||||
<div class="publ-to-main"><a href="<?=get_site_url()?>/category/sobytiya"> <span class="arrow-go-main"><</span> <span class="go-to-main">Все события</span></a></div>
|
||||
|
||||
|
||||
</div> <!-- end content -->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user