fixed scroll images

This commit is contained in:
2022-04-11 22:13:36 +03:00
parent 25df0b2c10
commit eb335f8d52
5 changed files with 286 additions and 30 deletions

View File

@@ -1,12 +1,12 @@
<?php $curr_id = get_the_id(); ?> <?php $curr_id = get_the_id(); ?>
<?if (!isset($_COOKIE[COOK_GOLOS])):?> <?//if (!isset($_COOKIE[COOK_GOLOS])):?>
<div id="golos-<?=$curr_id?>"> <div id="golos-<?=$curr_id?>">
<br><button style="padding: 8px; cursor: pointer;" id="golos" onclick="javascript:add_golos(<?= $curr_id;?>, 'golos-<?= $curr_id;?>');">Проголосовать</button> <br><button style="padding: 8px; cursor: pointer;" id="golos" onclick="javascript:add_golos(<?= $curr_id;?>, 'golos-<?= $curr_id;?>');">Проголосовать</button>
</div> </div>
<?endif?> <?//endif?>
<div id="golos-<?=$curr_id?>"> <div id="golos-<?=$curr_id?>">
<?if (isset($_COOKIE["vec_$curr_id"])):?> <?if (isset($_COOKIE["vec_$curr_id"])):?>

View File

@@ -5,8 +5,8 @@ use PHPMailer\PHPMailer\PHPMailer;
//setlocale(LC_ALL, 'ru_RU', 'ru_RU.UTF-8', 'ru', 'russian'); //setlocale(LC_ALL, 'ru_RU', 'ru_RU.UTF-8', 'ru', 'russian');
define('IMGURL', 'http://img.vetandlife.ru/'); define('IMGURL', 'http://img.vetandlife.ru/');
define("COOK_GOLOS", "_ya_id_76543_w"); define("COOK_GOLOS", "_ya_id_76577_w");
define("COOK_VALUE", "7895"); define("COOK_VALUE", "7896");
define('VIJ_CACHE', ABSPATH.'wp-content/themes/vij/cache/'); define('VIJ_CACHE', ABSPATH.'wp-content/themes/vij/cache/');
define('BASE_VIJ', ABSPATH.'wp-content/themes/vij/'); define('BASE_VIJ', ABSPATH.'wp-content/themes/vij/');
@@ -48,6 +48,11 @@ require get_template_directory().'/src/perevod.php';
require get_template_directory().'/lang.php'; require get_template_directory().'/lang.php';
require get_template_directory().'/blocks/card_post_id.php'; require get_template_directory().'/blocks/card_post_id.php';
//require ABSPATH.'vendor/masterforweb/db_lite/db_lite.php'; //require ABSPATH.'vendor/masterforweb/db_lite/db_lite.php';
function vij_send_smtp_email( PHPMailer $phpmailer ) { function vij_send_smtp_email( PHPMailer $phpmailer ) {
@@ -129,6 +134,14 @@ add_filter('category_template', function (){
}); });
//свой шаблон для категории //свой шаблон для категории
add_filter( 'single_template', function ( $single_template ) { add_filter( 'single_template', function ( $single_template ) {
@@ -646,9 +659,9 @@ add_action( 'init', function () {
}, 0); }, 0);
*/ */
add_action( 'pre_get_posts', function ($query) { add_action( 'pre_get_posts', function ($query) {
if ( ! is_admin() && $query->is_main_query() && is_category() ) { if ( ! is_admin() && $query->is_main_query() && is_category() ) {
@@ -671,6 +684,16 @@ add_action( 'pre_get_posts', function ($query) {
}); });
function print_menu_shortcode($atts=[], $content = null) {
$shortcode_atts = shortcode_atts([ 'name' => '', 'class' => '' ], $atts);
$name = $shortcode_atts['name'];
$class = $shortcode_atts['class'];
return wp_nav_menu( array( 'menu' => $name, 'menu_class' => $class, 'echo' => false ) );
}
add_shortcode('menu', 'print_menu_shortcode');
function add_text_to_the_feed_end( $content ){ function add_text_to_the_feed_end( $content ){
$content .= ' $content .= '
<p> <p>

View File

@@ -2,14 +2,15 @@
<html lang="ru"> <html lang="ru">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <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"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<title><?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?></title> <title><?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?></title>
<?if (defined('TESTMODE') and TESTMODE == 1):?> <?if (defined('TESTMODE') and TESTMODE == 1):?>
<link rel="stylesheet" href="<?php echo get_template_directory_uri();?>/style-test.css?ver=3"> <link rel="stylesheet" href="<?php echo get_template_directory_uri();?>/style-test.css?ver=3">
<?else:?> <?else:?>
<link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=167"> <link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=267">
<?endif?> <?endif?>
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet"> <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">--> <!--<link href="<?php echo get_stylesheet_directory_uri()?>/pub/fontawesome.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/jquery-3.6.0.min.js"></script>
@@ -62,14 +63,14 @@
</style> </style>
<div id="mainbanner"> <div id="mainbanner">
<img src ="https://vetandlife.ru/wp-content/themes/vij/pub/banners/page-banner-1600x100.jpg" /> <img src ="https://vetandlife.ru/wp-content/uploads/2022/04/3200x200-scaled.gif" />
</div> </div>
<?endif?> <?endif?>
<div id="mainbanner"> <div id="mainbanner">
<img src ="https://vetandlife.ru/wp-content/uploads/2022/04/1600x100.gif" /> <a href="https://vetandlife.ru/reklama-na-site/"><img src ="https://vetandlife.ru/wp-content/uploads/2022/04/3200x200_2.gif" /></a>
</div> </div>

View File

@@ -40,14 +40,15 @@ $nn = 0;?>
<?if ($nn == 10):?> <?if ($nn == 10):?>
<?card_post_id(18170, 'до 31 марта 2022 года')?> <?card_post_id(20427, 'до 13 апреля 2022 года')?>
<?endif?> <?endif?>
<div class="mini-card"> <div class="mini-card">
<?if ( has_post_thumbnail() ) :?> <?if ( has_post_thumbnail() ) :?>
<div class="mini-card-img"> <div class="mini-card-img">
<a href="<?the_permalink();?>"><img class="mini-card-img" src="<?php echo get_the_post_thumbnail_url(); ?>" alt="<?the_title();?>"> <a href="<?the_permalink();?>">
<img class="mini-card-img" src="<?php echo get_the_post_thumbnail_url(null, 'large'); ?>" alt="<?the_title();?>">
<?if( has_tag( 'видео' ) ):?> <?if( has_tag( 'видео' ) ):?>
<span class="play-card"></span> <span class="play-card"></span>
<?endif?> <?endif?>

265
style.css
View File

@@ -500,6 +500,38 @@ a{
} }
.orange_block a{
color: white !important;
}
.orange_button{
background: orange;
border-radius: 55px;
border: 1px solid orange;
color: white;
vertical-align: middle;
text-decoration: none;
text-transform: uppercase;
font-weight: bold;
font-size: 16px;
font-size: 11px;
line-height: 110%;
display: table-cell;
vertical-align: middle;
height: 45px;
padding-left: 22px;
padding-right: 22px;
}
.left_center_block{ .left_center_block{
margin-top: 8px; margin-top: 8px;
margin-bottom: 28px; margin-bottom: 28px;
@@ -603,11 +635,41 @@ a{
color: #F18129; color: #F18129;
} }
#content iframe{
width: 100%;
}
#content tr {
border-top: 1px solid #E9EAEB;
border-bottom: 1px solid #E9EAEB;
}
#content td {
padding: 20px 0;
}
#content h2, #content h3, #content h4{
margin-top: 12px;
margin-bottom: 18px;
}
.fulltext{
width: 100%;
}
.fulltext a{ .fulltext a{
color: #2D9CDB; color: #2D9CDB;
} }
.fulltext .current-menu-item a{
color: black;
}
.fulltext > ul{ .fulltext > ul{
list-style: square outside; list-style: square outside;
} }
@@ -636,6 +698,10 @@ a{
color: orange; color: orange;
} }
.fulltext {
margin-right: 8px;
}
#fulltext img, #fulltext img,
.wp-block-image img .wp-block-image img
{ {
@@ -708,6 +774,51 @@ a{
} }
.reklama_menu{
display: flex;
margin-left: 0;
margin-top: 22px;
margin-bottom: 22px;
font-size: 18px;
}
.reklama_menu li{
font-weight: bold;
margin-right:15px; /*Добавляем отступ у пунктов меню*/
}
.reklama_menu a:hover{
color: #2D9CDB;
}
.reklama_sub_h {
font-size: 18px;
color: #171717;
text-align: center;
padding: 20px 10px 20px 20px;
margin-right: 4px;
background-color: #F2F2F2;
}
.lmenu{ .lmenu{
display: inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
@@ -977,9 +1088,8 @@ a{
margin-bottom: 1em; /* Отступ снизу */ margin-bottom: 1em; /* Отступ снизу */
} }
#content IMG{ #content IMG{
max-width: 100%; width: 100%;
} }
#fulltext ul{ #fulltext ul{
@@ -2134,6 +2244,30 @@ span.rub_back_title{
display: none; display: none;
} }
#menu-reklama_menu{
padding-bottom: 22px;
}
#menu-reklama_menu li a{
color: black;
border: none;
}
#menu-reklama_menu li.current-menu-item{
color: #2D9CDB;
border-bottom: 1px solid #2D9CDB;
}
#menu-reklama_menu li.current-menu-item a{
color: #2D9CDB;
}
@media screen and ( max-width: 580px ) { @media screen and ( max-width: 580px ) {
#left{ #left{
@@ -2149,9 +2283,9 @@ span.rub_back_title{
margin: 0; margin: 0;
} }
#mainbanner { /** #mainbanner {
display: none; display: none;
} } */
#header_icons{ #header_icons{
margin-left: 0; margin-left: 0;
@@ -2164,7 +2298,7 @@ span.rub_back_title{
#content{ #content{
/*width: 100%;*/ width: 100%;
} }
@@ -2329,6 +2463,7 @@ span.rub_back_title{
body { body {
width: 100%; width: 100%;
margin-right: 8px; margin-right: 8px;
overflow-x: hidden;
} }
@@ -2457,19 +2592,63 @@ span.rub_back_title{
} }
.menu-reklama_menu-container{
display: inline-block;
margin: 0;
padding: 0;
margin-top: 22px;
margin-right: 22px;
overflow: hidden;
}
#menu-reklama_menu{
margin: 0;
padding: 0;
}
.reklama_menu {
display: flex;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
}
.reklama_menu li{
font-size: 13px;
margin-right: 12px;
padding-bottom: 12px;
}
.reklama_menu li a{
color: #909294;
}
.reklama_menu li a:hover{
color: #F18129;
}
.reklama_menu li.current-menu-item{
color: #171717;
font-weight: bold;
border-bottom: 3px solid #F18129;
}
.mini-card-img{
max-width: 100%;
overflow-x: hidden;
overflow-y: hidden;
}
} }
@media (max-width: 599px){
.wp-block-columns {
}
}
/** mobile **/ /** mobile **/
@media only screen @media only screen
@@ -2478,6 +2657,11 @@ and (max-device-width : 667px) {
#main{
width: 100%;
}
h1 { h1 {
font-size: 24px; font-size: 24px;
} }
@@ -2497,9 +2681,9 @@ and (max-device-width : 667px) {
display: block; display: block;
} }
#mainbanner { /**#mainbanner {
display: none; display: none;
} }*/
.mini-card{ .mini-card{
width: 100%; width: 100%;
@@ -2507,7 +2691,9 @@ and (max-device-width : 667px) {
} }
.mini-card-img{ .mini-card-img{
width: 100%; max-width: 100%;
overflow-x: hidden;
overflow-y: hidden;
} }
#footer-contact{ #footer-contact{
@@ -2576,8 +2762,53 @@ and (max-device-width : 667px) {
display: none; display: none;
} }
.menu-reklama_menu-container{
display: inline-block;
margin: 0;
padding: 0;
margin-top: 22px;
margin-right: 22px;
overflow: hidden;
}
#menu-reklama_menu{
margin: 0;
padding: 0;
margin-bottom: 22px;
}
.reklama_menu {
display: flex;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
}
.reklama_menu li{
font-size: 13px;
color: #909294;
margin-right: 12px;
padding-bottom: 12px;
}
.reklama_menu li a{
color: #909294;
}
.reklama_menu li a:hover{
color: #F18129;
}
.reklama_menu li.current-menu-item{
color: #171717;
font-weight: bold;
border-bottom: 3px solid #F18129;
}