add number arcticle
This commit is contained in:
@@ -514,6 +514,105 @@ function find_perevod($post_id){
|
||||
|
||||
}
|
||||
|
||||
# add concurs
|
||||
/**
|
||||
add_action( 'init', function () {
|
||||
|
||||
|
||||
// Указываем метки UI для произвольного типа записи
|
||||
|
||||
$labels = array(
|
||||
|
||||
'name' => _x( 'Movies', 'Post Type General Name', 'twentythirteen' ),
|
||||
|
||||
'singular_name' => _x( 'Movie', 'Post Type Singular Name', 'twentythirteen' ),
|
||||
|
||||
'menu_name' => __( 'Movies', 'twentythirteen' ),
|
||||
|
||||
'parent_item_colon' => __( 'Parent Movie', 'twentythirteen' ),
|
||||
|
||||
'all_items' => __( 'All Movies', 'twentythirteen' ),
|
||||
|
||||
'view_item' => __( 'View Movie', 'twentythirteen' ),
|
||||
|
||||
'add_new_item' => __( 'Add New Movie', 'twentythirteen' ),
|
||||
|
||||
'add_new' => __( 'Add New', 'twentythirteen' ),
|
||||
|
||||
'edit_item' => __( 'Edit Movie', 'twentythirteen' ),
|
||||
|
||||
'update_item' => __( 'Update Movie', 'twentythirteen' ),
|
||||
|
||||
'search_items' => __( 'Search Movie', 'twentythirteen' ),
|
||||
|
||||
'not_found' => __( 'Not Found', 'twentythirteen' ),
|
||||
|
||||
'not_found_in_trash' => __( 'Not found in Trash', 'twentythirteen' ),
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
// Задаем опции для произвольного типа записи
|
||||
|
||||
|
||||
|
||||
$args = array(
|
||||
|
||||
'label' => __( 'Конкурсы'),
|
||||
|
||||
'description' => __( 'Управление конкурсами' ),
|
||||
|
||||
'labels' => $labels,
|
||||
|
||||
'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields'),
|
||||
|
||||
'hierarchical' => false,
|
||||
|
||||
'public' => true,
|
||||
|
||||
'show_ui' => true,
|
||||
|
||||
'show_in_menu' => true,
|
||||
|
||||
'show_in_nav_menus' => true,
|
||||
|
||||
'show_in_admin_bar' => true,
|
||||
|
||||
'menu_position' => 5,
|
||||
|
||||
'can_export' => true,
|
||||
|
||||
'has_archive' => true,
|
||||
|
||||
'exclude_from_search' => false,
|
||||
|
||||
'publicly_queryable' => true,
|
||||
|
||||
'capability_type' => 'page',
|
||||
|
||||
|
||||
|
||||
// Вот здесь мы добавим таксономии в наш ПТЗ
|
||||
|
||||
'taxonomies' => [],
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
// Регистрируем произвольный тип записи
|
||||
|
||||
register_post_type( 'concurs', $args );
|
||||
|
||||
|
||||
|
||||
}, 0);
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
add_action( 'pre_get_posts', function ($query) {
|
||||
|
||||
if ( ! is_admin() && $query->is_main_query() ) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title><?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?></title>
|
||||
<link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=103">
|
||||
<link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=105">
|
||||
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">
|
||||
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/jquery-3.6.0.min.js"></script>
|
||||
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/golos.js"></script>
|
||||
|
||||
@@ -15,6 +15,7 @@ function number_info($title){
|
||||
if (isset($findpdf ['guid'])){
|
||||
$res['guid'] = $findpdf['guid'];
|
||||
$res['year'] = $items[4];
|
||||
$res['number'] = $number;
|
||||
}
|
||||
|
||||
return $res;
|
||||
|
||||
@@ -74,6 +74,13 @@ $nn = 0;?>
|
||||
<?get_template_part( '/blocks/citats', null, ['subclass' => 'mob-lite']);?>
|
||||
<?get_template_part( '/blocks/mosts', null, ['subclass' => 'mob-lite']);?>
|
||||
|
||||
<div class="mobile-info">
|
||||
<a href="https://www.youtube.com/channel/UCOXOjXmMNl8eVO4ldrv5c5Q" target="_blank">
|
||||
<img src="https://vetandlife.ru/wp-content/uploads/2021/10/melano-live.png" width="240" height="200" />
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div> <!-- end content -->
|
||||
|
||||
60
single-3.php
60
single-3.php
@@ -44,9 +44,63 @@ get_header();?>
|
||||
</div>
|
||||
<?endif?>
|
||||
</div>
|
||||
|
||||
<!--<p><small class="text-muted"><?php the_tags('');?></small></p> -->
|
||||
<?//endwhile;?>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?$posts = get_posts([
|
||||
'tag' => 'номер'.$curr_number['number']
|
||||
]);
|
||||
|
||||
$pitems = [];
|
||||
$endpolosa = 1;
|
||||
|
||||
foreach ($posts as $post){
|
||||
|
||||
$posttags = get_the_tags($post->ID);
|
||||
|
||||
foreach ($posttags as $tag){
|
||||
$pfind = strpos($tag->name, 'полоса');
|
||||
if ($pfind !== false) {
|
||||
$number = substr($tag->name, 0, $pfind);
|
||||
if ($number > $endpolosa ){
|
||||
$endpolosa = $number;
|
||||
}
|
||||
$pitems[$number][] = $post;
|
||||
}
|
||||
}
|
||||
}?>
|
||||
|
||||
<?for ($i = 1; $i <= $endpolosa; $i++) {?>
|
||||
<?if (isset($pitems[$i])):?>
|
||||
<h2 class="part_title">Полоса <?=$i?></h2>
|
||||
<?foreach($pitems[$i] as $item):?>
|
||||
<?$category = get_the_category($item->ID);
|
||||
$category_id = $category[0]->term_id;
|
||||
$category_link = get_category_link($category_id);?>
|
||||
<div class="main-card">
|
||||
<?if ( has_post_thumbnail($item->ID) ) :?>
|
||||
<div class="card-img-top">
|
||||
<a href="<?the_permalink($item->ID);?>"><img class="mini-card-img" src="<?php echo get_the_post_thumbnail_url($item->ID, 'large'); ?>" alt="<?=$item->title;?>"></a>
|
||||
<?if( has_tag( 'видео' ) ):?>
|
||||
<span class="play-card"></span>
|
||||
<?endif?>
|
||||
</div>
|
||||
<?endif?>
|
||||
<div class="main-card-title"><a href="<?the_permalink($item->ID);?>"><?=get_the_title($item->ID);?></a></div>
|
||||
<div class="main-card-body">
|
||||
<div class="main-card-text"><a href="<?the_permalink($item->ID);?>"><?=$item->post_excerpt?></a></div>
|
||||
<div class="news_date"><a href="<?=$category_link?>"><?=$category['0']->name?></a></div>
|
||||
</div>
|
||||
</div>
|
||||
<?endforeach?>
|
||||
<?endif?>
|
||||
<?}?>
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
$numbers_year = 2021;
|
||||
|
||||
40
style.css
40
style.css
@@ -143,6 +143,14 @@ a{
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.mobile-info{
|
||||
display: none;
|
||||
margin-top: 8px;
|
||||
margin-bottom: 12px;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wrap{
|
||||
transform: translate(0%, 0%);
|
||||
width: 0px;
|
||||
@@ -659,11 +667,11 @@ a{
|
||||
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/epizoo-orange.svg) left center;
|
||||
}
|
||||
|
||||
.menu-item-15, .menu-item-17475{
|
||||
.menu-item-15, .menu-item-17699{
|
||||
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/zoo.svg) left center;
|
||||
}
|
||||
|
||||
.menu-item-15:hover, .menu-item-17475:hover{
|
||||
.menu-item-15:hover, .menu-item-17699:hover{
|
||||
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/zoo-orange.svg) left center;
|
||||
}
|
||||
|
||||
@@ -684,11 +692,11 @@ a{
|
||||
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/nauka-orange.svg) left center;
|
||||
}
|
||||
|
||||
.menu-item-20{
|
||||
.menu-item-20, .menu-item-17475{
|
||||
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/zoobiz.svg) left center;
|
||||
}
|
||||
|
||||
.menu-item-20:hover{
|
||||
.menu-item-20:hover, .menu-item-17475:hover{
|
||||
background: no-repeat url(https://vetandlife.ru/wp-content/themes/vij/pub/menu/zoobiz-orange.svg) left center;
|
||||
}
|
||||
|
||||
@@ -1071,9 +1079,11 @@ a{
|
||||
|
||||
.numbers-year-title{
|
||||
font-weight: bold;
|
||||
font-size: 22px;
|
||||
border-bottom: 1px solid #F2F2F2;
|
||||
margin-top: 22px;
|
||||
padding-top: 12px;
|
||||
padding-bottom: 12px;
|
||||
padding-bottom: 22px;
|
||||
}
|
||||
|
||||
.play-card{
|
||||
@@ -1148,7 +1158,14 @@ a{
|
||||
|
||||
#nav_content li a{
|
||||
color: #909294;
|
||||
}
|
||||
}
|
||||
|
||||
.part_title{
|
||||
color: #171717;
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
margin-bottom: 28px;
|
||||
}
|
||||
|
||||
.main-card{
|
||||
padding-bottom: 22px;
|
||||
@@ -1160,7 +1177,8 @@ a{
|
||||
|
||||
.main-card-title{
|
||||
font-family: 'GrtskPeta';
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
font-size: 22px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@@ -1191,6 +1209,10 @@ a{
|
||||
padding: 8px 0 8px 0;
|
||||
}
|
||||
|
||||
.news_date a {
|
||||
color: #909294;
|
||||
}
|
||||
|
||||
|
||||
#events_left{
|
||||
padding: 8px;
|
||||
@@ -2122,6 +2144,10 @@ span.rub_back_title{
|
||||
display: block;
|
||||
}
|
||||
|
||||
.mobile-info{
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user