add blocks cache

This commit is contained in:
2023-07-28 11:59:42 +03:00
parent 83a2fcaa32
commit 85bdf0d8f2
8 changed files with 53 additions and 62 deletions

View File

@@ -10,9 +10,9 @@ $curr_post = get_post( $id );?>
<?if ( has_post_thumbnail($curr_post->ID) ) :?>
<div class="mini-card-img">
<a href="<?the_permalink($curr_post->ID);?>"><img class="mini-card-img" src="<?php echo get_the_post_thumbnail_url($curr_post->ID); ?>" alt="<?=$curr_post->post_title;?>">
<?if( has_tag( 'видео' ) ):?>
<span class="play-card"></span>
<?endif?>
<?//if( has_tag( 'видео' ) ):
// echo '<span class="play-card"></span>';
//endif?>
</a>
</div>
<?endif?>

View File

@@ -2,7 +2,7 @@
# три последних эвента
$posts = get_posts( array(
$zakon_posts = get_posts( array(
'numberposts' => 2,
'category' => 6,
'post_type' => 'post',
@@ -11,24 +11,22 @@ $posts = get_posts( array(
) );
# вывод поста
if( $posts ):?>
if( $zakon_posts ):?>
<div class="publs_right">
<div class="publs_right_title">Законодательство</div>
<?foreach($posts as $post):
setup_postdata( $post );
<?foreach($zakon_posts as $zakon):
//setup_postdata( $post );
?>
<div class="publs_right_item">
<a href="<?php the_permalink(); ?>"><?php the_title();?></a>
<a href="<?=get_permalink($zakon);?>"><?php echo $zakon->post_title;?></a>
</div>
<?php endforeach;?>
</div>
<?wp_reset_postdata();
endif;
<?endif;?>

View File

@@ -10,12 +10,22 @@
<?php // include VIJ_CACHE.'leftmenu.html';?>
<?php get_template_part( '/blocks/leftmenu');?>
<?php if (LANG_VERSION == 'en'){
get_blocks_gen( 'left_menu_en' );
} else {
get_blocks_gen( 'left_menu' );
}
//get_template_part( '/blocks/leftmenu');?>
<?if (LANG_VERSION == 'ru'):?>
<?php get_template_part( '/blocks/opinion', null, ['subclass' => '']);?>
<?php get_template_part( '/blocks/citats')?>
<?php // get_template_part( '/blocks/opinion', null, ['subclass' => '']);
get_blocks_gen('opinion');
?>
<?php // get_template_part( '/blocks/citats');
get_blocks_gen( 'citats' );?>
<?php //include VIJ_CACHE.'opinion.html';?>
<?php //get_template_part( '/blocks/citata', null, ['subclass' => '']);?>
<?php get_template_part( '/blocks/events');?>
@@ -71,34 +81,19 @@
<?if (LANG_VERSION == 'ru'):?>
<div class="right-info">
<a href="https://vetandlife.ru/parthers/ispytatelnyj-centr-fgbu-vgnki-provodit-razlichnye-vidy-issledovanij-po-vyyavleniju-falsifikacii-molochnoj-produkcii?erid=LatgBbd7S">
<img src="https://vetandlife.ru/wp-content/uploads/2023/05/vgnki_240x400_may23.jpg" width="240" height="400" />
</a>
</div>
<div class="right-info">
<a href="https://roskachestvo.gov.ru/organic/contest/?erid=LatgBhSgx" target="_blank">
<img src="https://vetandlife.ru/wp-content/uploads/2023/01/rop.png" width="240" height="97" />
</a>
<? banners_conf_display( 'vgnki_240x400' ) ?>
</div>
<?endif?>
<?if (LANG_VERSION == 'en'){
get_template_part( '/blocks/regulation');
}
else {
get_template_part( '/blocks/zakons');
}
?>
<?php //include VIJ_CACHE.'zakons.html';?>
// get_template_part( '/blocks/zakons');
get_blocks_gen( 'zakons' );
}?>
<?if (LANG_VERSION == 'en'):?>
<?get_template_part( '/blocks/enmosts', null, ['subclass' => '']);?>
@@ -146,18 +141,9 @@
<div class="mobile-info">
<a href="https://vetandlife.ru/parthers/ispytatelnyj-centr-fgbu-vgnki-provodit-razlichnye-vidy-issledovanij-po-vyyavleniju-falsifikacii-molochnoj-produkcii?erid=LatgBbd7S">
<img src="https://vetandlife.ru/wp-content/uploads/2023/05/vgnki_240x200_may23.jpg" width="240" height="200" />
</a>
<? banners_conf_display( 'vgnki_240x200' ) ?>
</div>
<div class="mobile-info">
<a href="https://roskachestvo.gov.ru/organic/contest/?erid=LatgBhSgx" target="_blank">
<img src="https://vetandlife.ru/wp-content/uploads/2023/01/rop.png" width="240" height="97" />
</a>
</div>
<?endif?>

View File

@@ -15,12 +15,12 @@ define('IMGSERVER', 'https://img.vetandlife.ru/');
require ABSPATH.'/vendor/autoload.php';
#отключаем автообновления
add_filter('pre_site_transient_update_core',create_function('$a', "return null;"));
wp_clear_scheduled_hook('wp_version_check');
//add_filter('pre_site_transient_update_core',create_function('$a', "return null;"));
//wp_clear_scheduled_hook('wp_version_check');
remove_action( 'load-update-core.php', 'wp_update_plugins' );
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );
wp_clear_scheduled_hook( 'wp_update_plugins' );
//remove_action( 'load-update-core.php', 'wp_update_plugins' );
//add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );
//wp_clear_scheduled_hook( 'wp_update_plugins' );
#отключаем эмодзи

View File

@@ -4,12 +4,13 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="yandex-verification" content="22f98955910722f8" />
<meta name="zen-verification" content="9Ui9YzVJgKUB7bIgRNnAZqdHCNI8v9REm3TDpW0kciEicYyuD640moNznBDbFqcT" />
<title><?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?></title>
<?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=360">
<link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=364">
<?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">-->
@@ -105,15 +106,14 @@ screen.colorDepth:screen.pixelDepth))+";u"+escape(document.URL)+
<?else:?>
<div id="mainbanner">
<a href=" https://vetandlife.ru/reklama-special?erid=LatgBVedN"><img src ="https://vetandlife.ru/wp-content/uploads/2022/04/2000x125_64c.gif?ver=2" /></a>
<? banners_conf_display( 'mainbanner' ) ?>
</div>
<div id="mobmainbanner">
<a href=" https://vetandlife.ru/reklama-special?erid=LatgBVedN"><img src =" https://vetandlife.ru/wp-content/uploads/2022/04/554x86.gif?ver=2" /></a>
<? banners_conf_display( 'mobmainbanner' ) ?>
</div>
<?endif?>

View File

@@ -41,9 +41,13 @@ $nn = 0;?>
<?$nn++?>
<?//if ($nn == 5):
// card_post_id(25830, '');
<?//if ($nn == 1):
//card_post_id(28999, '');
// include get_template_directory().'/blocks/card_post_happy.php';
//elseif($nn == 3):
//card_post_id(29001, '');
//elseif($nn == 4):
//card_post_id(29005, '');
//endif?>
<?if ($nn < 25):?>

View File

@@ -10,7 +10,8 @@ get_header();?>
<?if (isset($_POST['email'])) {
$email = trim($_POST['email']);
$email = strtolower(trim($_POST['email']));
if (filter_var($email, FILTER_VALIDATE_EMAIL)) {

View File

@@ -81,6 +81,7 @@ a{
display: flex;
min-height: 100vh;
width: 100%;
overflow-x: hidden;
font-family: 'GrtskPeta';
flex-direction: column;
margin: 0;
@@ -592,11 +593,6 @@ a{
.orange_block a{
color: white !important;
}
.orange_button{
background: orange;
@@ -619,6 +615,11 @@ a{
}
.orange_block a{
color: white !important;
}
@@ -1916,6 +1917,7 @@ a{
.form-right input{
width: 230px;
height: 50px;
font-size: 15px;
border-radius: 35px;
background: #F2F2F2;
border: 1px solid #F2F2F2;