add menus

This commit is contained in:
2021-09-18 01:30:09 +03:00
parent 5a50fb1a94
commit d9c6a87cfe
11 changed files with 350 additions and 29 deletions

34
blocks/events.php Normal file
View File

@@ -0,0 +1,34 @@
<?php
# три последних эвента
$posts = get_posts( array(
'numberposts' => 3,
'category' => 44, // 44 - мероприятия
'orderby' => 'date',
'order' => 'DESC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
# вывод поста
if( $posts ):
foreach($posts as $post):
setup_postdata( $post );
?>
<div class="event">
<div class="news_date"><?the_time('j F Y');?></div>
<a href="<?php the_permalink(); ?>"><?php the_title();?></a>
</div>
<?php endforeach;
wp_reset_postdata();
endif;

37
blocks/moread.php Normal file
View File

@@ -0,0 +1,37 @@
<?php
$posts = get_posts( array(
'numberposts' => 4,
'category' => 0, // пока без категории
'orderby' => 'date',
'order' => 'DESC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
# вывод поста
if( $posts ):?>
<div class="moread">
<h4>Самое читаемое:</h3>
<?php foreach($posts as $post):
setup_postdata( $post );
?>
<div class="moread_card">
<img src="<?php echo get_the_post_thumbnail_url($post, 'moread');?>" alt="<?the_title();?>">
<a href="<?php the_permalink(); ?>"><?php the_title();?></a>
<div><?the_time('j F Y, G:i');?></div>
</div>
<?php endforeach;?>
</div>
<?php wp_reset_postdata();
endif?>

35
blocks/mosts.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
$posts = get_posts( array(
'numberposts' => 3,
'category' => 0, // пока без категории
'orderby' => 'date',
'order' => 'DESC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
# вывод поста
if( $posts ):?>
<div id="mosts">
<h3 class="most_title">Самое читаемое:</h3>
<?php foreach($posts as $post):
setup_postdata( $post );
?>
<div class="most">
<a href="<?php the_permalink(); ?>"><?php the_title();?></a>
</div>
<?php endforeach;?>
</div>
<?php wp_reset_postdata();
endif?>

31
blocks/opinion.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
$posts = get_posts( array(
'numberposts' => 1,
'category' => 7, // 7 - мнения
'orderby' => 'date',
'order' => 'DESC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
# вывод поста
if( $posts ):
foreach($posts as $post):
setup_postdata( $post );
?>
<img class="left_preview" src="<?php echo get_the_post_thumbnail_url($post, 'left-thumb');?>" alt="<?the_title();?>">
<a href="<?php the_permalink(); ?>"><?php the_title();?></a>
<?php endforeach;
wp_reset_postdata();
endif;

0
blocks/subscipts.php Normal file
View File