add new concurs
This commit is contained in:
@@ -17,7 +17,7 @@ $posts = get_posts( array(
|
||||
),
|
||||
),
|
||||
'post_type' => 'post',
|
||||
//'post_status' => 'publish',
|
||||
'post_status' => 'publish',
|
||||
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
|
||||
) );
|
||||
|
||||
|
||||
21
blocks/golos.php
Normal file
21
blocks/golos.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php $curr_id = get_the_id(); ?>
|
||||
|
||||
<?if (!isset($_COOKIE[COOK_GOLOS])):?>
|
||||
|
||||
<div id="golos-<?=$curr_id?>">
|
||||
<br><button style="padding: 8px; cursor: pointer;" id="golos" onclick="javascript:add_golos(<?= $curr_id;?>, 'golos-<?= $curr_id;?>');">Проголосовать</button>
|
||||
</div>
|
||||
|
||||
<?endif?>
|
||||
|
||||
<div id="golos-<?=$curr_id?>">
|
||||
<?if (isset($_COOKIE["vec_$curr_id"])):?>
|
||||
<p>Спасибо за Ваш голос</p>
|
||||
<?endif?>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="count-<?=$ID?>" style="margin-top: 12px;">
|
||||
<i class="far fa-thumbs-up"></i> <?=$votes->$curr_id?>
|
||||
</div>
|
||||
|
||||
88
category-5122.php
Normal file
88
category-5122.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* The main template file.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
get_header();
|
||||
$nn = 0;
|
||||
$ids = [];
|
||||
|
||||
$votes_file = '/vhosts/beta/wp-content/themes/vij/golos.json';
|
||||
//$votes_file = '/thosts/vij/wp/wp-content/themes/vij/golos.json';
|
||||
|
||||
if (file_exists($votes_file)){
|
||||
$votes = json_decode(file_get_contents($votes_file, true));
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?
|
||||
|
||||
$category = get_queried_object();
|
||||
$current_cat_id = $category->term_id;
|
||||
|
||||
$part_args = [
|
||||
'category__in' => $current_cat_id,
|
||||
'posts_per_page' => 23,
|
||||
'paged' => $paged
|
||||
|
||||
];
|
||||
|
||||
$part_query = new WP_Query( $part_args );
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div id="content">
|
||||
|
||||
|
||||
<ul id="nav_content">
|
||||
<li><a href="https://vetandlife.ru">Главная</li>
|
||||
<li> - <?single_cat_title()?></li>
|
||||
</ul>
|
||||
|
||||
<h1 class="my-4"><?=single_cat_title()?></h1>
|
||||
|
||||
<? if($part_query->have_posts()) :?>
|
||||
|
||||
<?while( $part_query->have_posts() ) :
|
||||
|
||||
$part_query->the_post();?>
|
||||
|
||||
<div class="search-card">
|
||||
|
||||
<div class="search-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></div>
|
||||
<?if ( has_post_thumbnail() ) :?>
|
||||
<a href="<?the_permalink();?>">
|
||||
<img class="search-card-img" src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" width="180" alt="<?the_title();?>">
|
||||
</a>
|
||||
<?endif?>
|
||||
|
||||
|
||||
<?include('blocks/golos.php')?>
|
||||
|
||||
|
||||
<div class="mini-card-body">
|
||||
<div class="news_date"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?endwhile;?>
|
||||
|
||||
<?endif?>
|
||||
|
||||
<?$GLOBALS['wp_query']->max_num_pages = $part_query->max_num_pages?>
|
||||
|
||||
<?get_template_part( '/blocks/paginator');?>
|
||||
|
||||
|
||||
<?wp_reset_postdata();?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
23
footer.php
23
footer.php
@@ -41,7 +41,7 @@
|
||||
|
||||
<a href="https://vk.com/vizhuvizh" target="_blank"><i style="color: #3B83B5;" class="fab fa-vk btn_soc"></i></a>
|
||||
<a href="https://t.me/ViZHuvizh" target="_blank"><i style="color: #3B83B5;" class="fab fa-telegram-plane btn_soc"></i></a>
|
||||
<a href="https://www.youtube.com/channel/UCGRWr7wG8zxFBMMKdPzYPUQ" target="_blank"><i style="color: red;" class="fab fa-youtube btn_soc"></i></a>
|
||||
<a href="https://www.youtube.com/c/ВетеринарияиЖизнь" target="_blank"><i style="color: red;" class="fab fa-youtube btn_soc"></i></a>
|
||||
|
||||
<!-- <div class="btn soc_vk"></div>
|
||||
<div class="soc_btn soc_fb"></div>
|
||||
@@ -74,8 +74,8 @@
|
||||
</div>
|
||||
|
||||
<div class="right-info">
|
||||
<a href="https://vetandlife.ru/parthers/fgbu-vgnki-provodit-mezhlaboratornye-slichitelnye-ispytaniya-msi-v-oblasti-pokazatelej-kachestva-i-bezopasnosti-pishhevyh-produktov-rastitelnogo-i-zhivotnogo-proishozhdeniya-kormov-i-kormovyh-sredstv/">
|
||||
<img src="https://vetandlife.ru/wp-content/uploads/2022/01/vgnki_240x400_january.jpg" width="240" height="400" />
|
||||
<a href="https://vetandlife.ru/parthers/fgbu-vgnki-priglashaet-na-obuchajushhie-meropriyatiya-v-oblasti-veterinarii/">
|
||||
<img src="https://vetandlife.ru/wp-content/uploads/2022/04/vgnki_240x400_4.jpg" width="240" height="400" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -140,8 +140,8 @@
|
||||
|
||||
<?if (LANG_VERSION == 'ru'):?>
|
||||
<div class="mobile-info">
|
||||
<a href="https://vetandlife.ru/parthers/fgbu-vgnki-provodit-mezhlaboratornye-slichitelnye-ispytaniya-msi-v-oblasti-pokazatelej-kachestva-i-bezopasnosti-pishhevyh-produktov-rastitelnogo-i-zhivotnogo-proishozhdeniya-kormov-i-kormovyh-sredstv/" target="_blank">
|
||||
<img src="https://vetandlife.ru/wp-content/uploads/2022/01/vgnki_240x200_january.jpg" width="240" height="200" />
|
||||
<a href="https://vetandlife.ru/parthers/fgbu-vgnki-priglashaet-na-obuchajushhie-meropriyatiya-v-oblasti-veterinarii/" target="_blank">
|
||||
<img src="https://vetandlife.ru/wp-content/uploads/2022/04/vgnki_240x200_4.jpg" width="240" height="200" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -186,10 +186,21 @@
|
||||
<img id="img_qr" src = "<?=get_stylesheet_directory_uri()?>/pub/icons/qvij.svg" width="100" height="100" />
|
||||
<p class="vazh"><?=vij_lang('qrtitle', LANG_VERSION);?></p>
|
||||
</div> -->
|
||||
|
||||
<div id="footer_qr">
|
||||
<div class="footer_qr">
|
||||
<img id="img_qr" src = "<?=get_stylesheet_directory_uri()?>/pub/icons/zen-code.svg" width="100" height="100" />
|
||||
<p class="vazh">"ВиЖ"<br>Яндекс.Дзен</p>
|
||||
</div>
|
||||
<div class="footer_qr qr_vk">
|
||||
<img id="img_qr" src = "<?=get_stylesheet_directory_uri()?>/pub/icons/qr-vk.svg" width="100" height="100" />
|
||||
<p class="vazh">"ВиЖ"<br>ВКонтакте</p>
|
||||
</div>
|
||||
<div class="footer_qr qr_telega">
|
||||
<img id="img_qr" src = "<?=get_stylesheet_directory_uri()?>/pub/icons/qr-telega.svg" width="100" height="100" />
|
||||
<p class="vazh">"ВиЖ"<br>Telegram</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="footer-contact">
|
||||
<div id="head_tel"><a href="tel:79250634">+7 (495) 925 06 34</a></div>
|
||||
@@ -207,7 +218,7 @@
|
||||
|
||||
<a href="https://vk.com/vizhuvizh" target="_blank"><i style="color: #3B83B5;" class="fab fa-vk btn_soc"></i></a>
|
||||
<a href="https://t.me/ViZHuvizh" target="_blank"><i style="color: #3B83B5;" class="fab fa-telegram-plane btn_soc"></i></a>
|
||||
<a href="https://www.youtube.com/channel/UCGRWr7wG8zxFBMMKdPzYPUQ" target="_blank"><i style="color: red;" class="fab fa-youtube btn_soc"></i></a>
|
||||
<a href="https://www.youtube.com/c/ВетеринарияиЖизнь" target="_blank"><i style="color: red;" class="fab fa-youtube btn_soc"></i></a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<?if (defined('TESTMODE') and TESTMODE == 1):?>
|
||||
<link rel="stylesheet" href="<?php echo get_template_directory_uri();?>/style-test.css?ver=3">
|
||||
<?else:?>
|
||||
<link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=163">
|
||||
<link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=167">
|
||||
<?endif?>
|
||||
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet">
|
||||
<!--<link href="<?php echo get_stylesheet_directory_uri()?>/pub/fontawesome.css" rel="stylesheet">-->
|
||||
@@ -67,6 +67,12 @@
|
||||
|
||||
<?endif?>
|
||||
|
||||
|
||||
<div id="mainbanner">
|
||||
<img src ="https://vetandlife.ru/wp-content/uploads/2022/04/1600x100.gif" />
|
||||
</div>
|
||||
|
||||
|
||||
<? $lang_version = lang_version();
|
||||
|
||||
if ($lang_version == 'en'){
|
||||
|
||||
112
single-5122.php
Normal file
112
single-5122.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?php get_header();?>
|
||||
|
||||
<div id="content">
|
||||
|
||||
<?//while(have_posts()):?>
|
||||
<?the_post();?>
|
||||
|
||||
|
||||
<?php $category = get_the_category();
|
||||
$category_id = $category[0]->term_id;
|
||||
$category_link = get_category_link($category_id);
|
||||
|
||||
|
||||
$votes_file = '/vhosts/beta/wp-content/themes/vij/golos.json';
|
||||
|
||||
if (file_exists($votes_file)){
|
||||
$votes = json_decode(file_get_contents($votes_file, true));
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<ul id="nav_content">
|
||||
<li><a href="<?=get_site_url()?>">Главная</li>
|
||||
<li>-<li>
|
||||
<li><a href="<?=$category_link?>"><?=$category['0']->name;?></a></li>
|
||||
<li>-<li>
|
||||
<li><?=mb_substr(get_the_title(), 0, 50);?>...</li>
|
||||
</ul>
|
||||
|
||||
<div class="post_info">
|
||||
<div class="post_info_sub">
|
||||
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category['0']->name;?></a></span>
|
||||
</div>
|
||||
<div class="post_info_sub post_info_social">
|
||||
<?php include get_template_directory().'/blocks/social-share.php';?>
|
||||
</div>
|
||||
</div>
|
||||
<h1 class="post-h1"><?php wp_title('');?></h1>
|
||||
|
||||
<?if ( has_post_thumbnail() ) :?>
|
||||
<div id="post-img">
|
||||
<img class="img-fluid rounded" src="<?php echo get_the_post_thumbnail_url(null, 'full');?>" alt="<?the_title();?>">
|
||||
</div>
|
||||
<div class="post_img_title"><?the_post_thumbnail_caption()?></div>
|
||||
<?endif?>
|
||||
<div class="fulltext"><?the_content();?></div>
|
||||
<!--<p><small class="text-muted"><?php the_tags('');?></small></p> -->
|
||||
<?//endwhile;?>
|
||||
|
||||
<?include('blocks/golos.php')?>
|
||||
|
||||
<div class="yets_rubric">Другие участники</div>
|
||||
|
||||
<div class="yets">
|
||||
|
||||
<?$prevpost = get_previous_post(True)?>
|
||||
|
||||
<?if ($prevpost !== ''):?>
|
||||
<div class="yet_card">
|
||||
<div class="yet_title"><a href="<?=get_permalink($prevpost->ID)?>"><< <?=$prevpost->post_title;?></a></div>
|
||||
</div>
|
||||
<?else:?>
|
||||
<div class="yet_card">
|
||||
<div class="yet_title"><a href="<?=get_category_link(35)?>"><< Все участники</a></div>
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
<?$nextpost = get_next_post(True)?>
|
||||
<?if ($nextpost !== ''):?>
|
||||
<div class="yet_card">
|
||||
<div class="yet_title"><a href="<?=get_permalink($nextpost->ID)?>"><?=$nextpost->post_title;?> >></a></div>
|
||||
</div>
|
||||
<?else:?>
|
||||
<div class="yet_card">
|
||||
<div class="yet_title"><a href="<?=get_category_link(35)?>">Все участники >></a></div>
|
||||
</div>
|
||||
<?endif?>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="tags">
|
||||
<?php the_tags();?>
|
||||
</div>
|
||||
|
||||
<div class="post_panel_info">
|
||||
<div class="post_panel_info_sub">
|
||||
<!--Поделиться <i class="fas fa-share-square btn_soc_post"></i>--> <?php include get_template_directory().'/blocks/social-share.php';?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include get_template_directory().'/blocks/moread.php';?>
|
||||
|
||||
<div class="publ-to-main"><a href="<?=get_site_url()?>"> <span class="arrow-go-main"><</span> <span class="go-to-main">На главную</span></a></div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php get_footer();?>
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<div class="post_info">
|
||||
<div class="post_info_sub">
|
||||
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category['0']->name;?></a></span>, <?php the_time('j F Y, G:i');?>
|
||||
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category['0']->name;?></a></span>, <nobr><?php the_time('j F Y, G:i');?></nobr>
|
||||
</div>
|
||||
<div class="post_info_sub post_info_social">
|
||||
<?php include get_template_directory().'/blocks/social-share.php';?>
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<div class="post_panel_info">
|
||||
<div class="post_panel_info_sub">
|
||||
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category['0']->name;?></a></span>, <?php the_time('j F Y, G:i');?>
|
||||
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category['0']->name;?></a></span>, <nobr><?php the_time('j F Y, G:i');?></nobr>
|
||||
</div>
|
||||
<div class="post_panel_info_sub">
|
||||
<!--Поделиться <i class="fas fa-share-square btn_soc_post"></i>--> <?php include get_template_directory().'/blocks/social-share.php';?>
|
||||
|
||||
@@ -15,7 +15,10 @@ function calend_block($month, $year, $script=false){
|
||||
$find_sql = "
|
||||
SELECT `post_id`
|
||||
FROM `wp_postmeta`
|
||||
WHERE `meta_key` = 'startevent' AND `meta_value` BETWEEN '$year-$str_month-01T00:00:00' AND '$year-$str_month-31T23:59:59'
|
||||
WHERE `meta_key` = 'startevent'
|
||||
AND `meta_value`
|
||||
BETWEEN '$year-$str_month-01T00:00:00' AND '$year-$str_month-31T23:59:59'
|
||||
|
||||
";
|
||||
|
||||
|
||||
@@ -26,7 +29,7 @@ function calend_block($month, $year, $script=false){
|
||||
if ($ins !== '') {
|
||||
|
||||
$posts = db_get("
|
||||
SELECT ID, post_date, post_title FROM `wp_posts` WHERE ID IN ($ins)
|
||||
SELECT ID, post_date, post_title FROM `wp_posts` WHERE ID IN ($ins) AND `post_status` = 'publish'
|
||||
");
|
||||
}
|
||||
|
||||
|
||||
41
style.css
41
style.css
@@ -106,6 +106,23 @@ a{
|
||||
}
|
||||
|
||||
|
||||
#mainbanner{
|
||||
width: 100%;
|
||||
display: block;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#mainbanner img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
max-width: 1600px;
|
||||
margin: auto;
|
||||
border: 1px solid black;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#left{
|
||||
max-width: 330px;
|
||||
display: flex;
|
||||
@@ -358,15 +375,21 @@ a{
|
||||
margin-bottom: 28px;
|
||||
padding-top: 28px;
|
||||
padding-bottom: 28px;
|
||||
padding-left: 12px;
|
||||
|
||||
}
|
||||
|
||||
#footer_qr{
|
||||
width: 20%;
|
||||
width: 25%;
|
||||
display: grid;
|
||||
margin-right: 12px;
|
||||
text-align: center;
|
||||
grid-gap: .5rem;
|
||||
grid-template-columns: repeat(auto-fit, minmax(10px, 1fr));
|
||||
}
|
||||
|
||||
|
||||
|
||||
#img_qr{
|
||||
padding: 4px;
|
||||
background-color: white;
|
||||
@@ -374,12 +397,13 @@ a{
|
||||
|
||||
#footer-contact{
|
||||
width: 20%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#footer_subscript{
|
||||
margin-left: 32px;
|
||||
margin-right: 22px;
|
||||
width: 25%;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
#footer_logo{
|
||||
@@ -484,7 +508,7 @@ a{
|
||||
.vazh{
|
||||
font-size: 9px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.45em;
|
||||
/*letter-spacing: 0.45em;*/
|
||||
}
|
||||
|
||||
.current-number{
|
||||
@@ -1099,7 +1123,6 @@ a{
|
||||
display: grid;
|
||||
grid-gap: 2rem;
|
||||
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
|
||||
/*grid-template-columns: repeat(2, minmax(250px, 1fr));*/
|
||||
}
|
||||
|
||||
|
||||
@@ -2126,6 +2149,10 @@ span.rub_back_title{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#mainbanner {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#header_icons{
|
||||
margin-left: 0;
|
||||
padding-right: 8px;
|
||||
@@ -2336,6 +2363,7 @@ span.rub_back_title{
|
||||
|
||||
#footer-contact{
|
||||
display: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#content{
|
||||
@@ -2448,6 +2476,8 @@ span.rub_back_title{
|
||||
and (min-device-width : 340px)
|
||||
and (max-device-width : 667px) {
|
||||
|
||||
|
||||
|
||||
h1 {
|
||||
font-size: 24px;
|
||||
}
|
||||
@@ -2467,6 +2497,9 @@ and (max-device-width : 667px) {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#mainbanner {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.mini-card{
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user