new design

This commit is contained in:
2022-08-16 10:37:55 +03:00
parent cebc3aca47
commit c1cf264f28
7 changed files with 200 additions and 10 deletions

82
author.php Normal file
View File

@@ -0,0 +1,82 @@
<?php
/**
* The main template file.
*
*/
get_header();
$nn = 0;?>
<div id="content">
<ul id="nav_content">
<li><a href="<?=get_home_url()?>">Главная</a></li>
<li> - <?=get_the_author();?></li>
</ul>
<h1 class="my-4"><?=get_the_author();?></h1>
<?php if(have_posts()) : while(have_posts()) : the_post();?>
<?$nn++;?>
<?if ($nn == 0):?>
<div class="main-card">
<?if ( has_post_thumbnail() ) :?>
<div class="card-img-top">
<a href="<?the_permalink();?>"><img class="card-img-top" src="<?php echo get_the_post_thumbnail_url(null, 'full'); ?>" alt="<?the_title();?>">
<?if( has_tag( 'видео' ) ):?>
<span class="play-card"></span>
<?endif?>
</a>
</div>
<?endif?>
<h2 class="main-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
<div class="main-card-body">
<div class="main-card-text"><a href="<?the_permalink();?>"><?the_excerpt();?></a></div>
<div class="news_date"><?the_time('j F Y, G:i');?></div>
</div>
</div>
<?elseif ($nn == 1):?>
<div class="mini-card-block">
<?endif?>
<?if ($nn > 0):?>
<div class="mini-card">
<?if ( has_post_thumbnail() ) :?>
<div class="mini-card-img">
<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( 'видео' ) ):?>
<span class="play-card"></span>
<?endif?>
</a>
</div>
<?endif?>
<h2 class="mini-card-title"><a href="<?the_permalink();?>"><?the_title();?></a></h2>
<div class="mini-card-body">
<div class="news_date"><?the_time('j F Y, G:i');?></div>
</div>
</div>
<?endif?>
<?php endwhile;?>
</div> <!--//end minicard block -->
<?else:?>
Здесь пока нет публикаций
<?php endif;?>
<?get_template_part( '/blocks/paginator');?>
</div>
<?php get_footer(); ?>

View File

@@ -27,6 +27,13 @@
</a> </a>
</div> </div>
<div class="right-info">
<a href="https://seafoodexporussia.com/?utm_source=website&utm_medium=banner&utm_campaign=vetandlife_main" target="_blank">
<img src="https://vetandlife.ru/wp-content/uploads/2022/07/240х400_2022.gif" width="240" height="400" />
</a>
</div>
<?endif?> <?endif?>
@@ -74,11 +81,12 @@
</div> </div>
<div class="right-info"> <div class="right-info">
<a href="https://vetandlife.ru/parthers/fgbu-vgnki-priglashaet-na-obuchajushhie-meropriyatiya-v-oblasti-veterinarii/"> <a href="https://vetandlife.ru/parthers/fgbu-vgnki-provodit-polnyj-spektr-neobhodimyh-dlya-registracii-doklinicheskih-toksikologicheskih-issledovanij-lekarstvennyh-sredstv-dlya-veterinarnogo-primeneniya-i-kormovyh-dobavok/">
<img src="https://vetandlife.ru/wp-content/uploads/2022/04/vgnki_240x400_4.jpg" width="240" height="400" /> <img src="https://vetandlife.ru/wp-content/uploads/2022/07/vgnki_240x400_july.jpg" width="240" height="400" />
</a> </a>
</div> </div>
<?endif?> <?endif?>
@@ -91,6 +99,8 @@
} }
?> ?>
<?php //include VIJ_CACHE.'zakons.html';?> <?php //include VIJ_CACHE.'zakons.html';?>
<?if (LANG_VERSION == 'en'):?> <?if (LANG_VERSION == 'en'):?>
@@ -103,7 +113,15 @@
<?//php include VIJ_CACHE.'mosts.html';?> <?//php include VIJ_CACHE.'mosts.html';?>
</div> </div>
</div><!-- end main --> </div><!-- end main -->
<?if (LANG_VERSION == 'ru'):?> <?if (LANG_VERSION == 'ru'):?>
@@ -115,6 +133,12 @@
</a> </a>
</div> </div>
<div class="mobile-info">
<a href="https://seafoodexporussia.com/?utm_source=website&utm_medium=banner&utm_campaign=vetandlife_main" target="_blank">
<img src="https://vetandlife.ru/wp-content/uploads/2022/07/240х200.gif" width="240" height="200" />
</a>
</div>
<?get_template_part( '/blocks/mosts', null, ['subclass' => 'mob-lite']);?> <?get_template_part( '/blocks/mosts', null, ['subclass' => 'mob-lite']);?>
@@ -130,8 +154,8 @@
<?if (LANG_VERSION == 'ru'):?> <?if (LANG_VERSION == 'ru'):?>
<div class="mobile-info"> <div class="mobile-info">
<a href="https://vetandlife.ru/parthers/fgbu-vgnki-priglashaet-na-obuchajushhie-meropriyatiya-v-oblasti-veterinarii/" target="_blank"> <a href="https://vetandlife.ru/parthers/fgbu-vgnki-provodit-polnyj-spektr-neobhodimyh-dlya-registracii-doklinicheskih-toksikologicheskih-issledovanij-lekarstvennyh-sredstv-dlya-veterinarnogo-primeneniya-i-kormovyh-dobavok/" target="_blank">
<img src="https://vetandlife.ru/wp-content/uploads/2022/04/vgnki_240x200_4.jpg" width="240" height="200" /> <img src="https://vetandlife.ru/wp-content/uploads/2022/07/vgnki_240x200_july.jpg" width="240" height="200" />
</a> </a>
</div> </div>

View File

@@ -678,6 +678,10 @@ add_action( 'pre_get_posts', function ($query) {
$query->set( 'posts_per_page', 23 ); $query->set( 'posts_per_page', 23 );
} }
if (is_author()){
$query->set( 'posts_per_page', 23 );
}
} }
@@ -706,3 +710,47 @@ function add_text_to_the_feed_end( $content ){
add_filter( 'the_excerpt_rss', 'add_text_to_the_feed_end' ); add_filter( 'the_excerpt_rss', 'add_text_to_the_feed_end' );
function add_div_youtube($content){
$content = str_replace(
['<iframe', '</iframe>'],
['<div class="vijdeo"><iframe', '</iframe></div>'],
$content);
return $content;
}
add_filter('the_content', 'add_div_youtube');
//preview
ini_set('display_errors', 'off');
add_filter( 'posts_results', 'set_query_to_draft', null, 2 );
function set_query_to_draft( $posts, &$query ) {
if ( sizeof( $posts ) != 1 )
return $posts;
$post_status_obj = get_post_status_object(get_post_status( $posts[0]));
if ( !$post_status_obj->name == 'draft' )
return $posts;
if ( $_GET['key'] != 'guest' )
return $posts;
$query->_draft_post = $posts;
add_filter( 'the_posts', 'show_draft_post', null, 2 );
}
function show_draft_post( $posts, &$query ) {
remove_filter( 'the_posts', 'show_draft_post', null, 2 );
return $query->_draft_post;
}

View File

@@ -3,21 +3,38 @@
<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.0, maximum-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<meta name="yandex-verification" content="257783249ab3fa7e" />
<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=274"> <link rel="stylesheet" href="<?php echo get_stylesheet_uri();?>?ver=277">
<?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>
<script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/golos.js"></script> <script type='text/javascript' src="<?php echo get_stylesheet_directory_uri()?>/scripts/golos.js"></script>
<meta property="og:title" content="<?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?>" /> <meta property="og:title" content="<?php wp_title('|', true, 'right');?><?=get_bloginfo('name')?>" />
<link type="image/x-icon" href="/favicon. ico" rel="shortcut icon"> <link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">
<link type="Image/x-icon" href="/favicon. ico" rel="icon"> <link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<link type="image/x-icon" href="https://vetandlife.ru/favicon.ico" rel="shortcut icon">
<link type="Image/x-icon" href="https://vetandlife.ru/favicon.ico" rel="icon">
<?if (isset($post->ID)):?> <?if (isset($post->ID)):?>
<meta property="og:description" content="<?=strip_tags(get_the_excerpt( $post->ID ))?>" /> <meta property="og:description" content="<?=strip_tags(get_the_excerpt( $post->ID ))?>" />
<?if( has_post_thumbnail()): <?if( has_post_thumbnail()):

View File

@@ -105,7 +105,7 @@ get_header();?>
<?php <?php
$numbers_year = 2021; $numbers_year = date('Y');
include get_template_directory().'/blocks/arh_more.php'; include get_template_directory().'/blocks/arh_more.php';
?> ?>

View File

@@ -718,6 +718,24 @@ a{
margin-right: 8px; margin-right: 8px;
} }
.vijdeo {
position:relative;
padding: 0 0 56.25% 0;
height:0;
overflow:hidden;
}
.vijdeo iframe,.vijdeo object,.vijdeo embed {
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
}
#fulltext img, #fulltext img,
.wp-block-image img .wp-block-image img
{ {

View File

@@ -4,9 +4,10 @@
require '/vhosts/beta/vendor/autoload.php'; require '/vhosts/beta/vendor/autoload.php';
dbl_config('vetandlife', 'mysql:host=mysql;dbname=vetandlife', 'vetandlife', 'g-34hJk-3-er2'); dbl_config('vetandlife', 'mysql:host=mysql;dbname=vetandlife', 'vetandlife', 'g-34hJk-3-er2');
$currdate = date('Y-m-d H:i:s');
$future_sql = "SELECT ID FROM `wp_posts` WHERE `post_status` = 'future' AND `post_date` <= '$currdate' ";
$future_news = db_get("SELECT ID FROM `wp_posts` WHERE `post_status` = 'future' AND `post_date` <= current_date() "); $future_news = db_get($future_sql);
if (count($future_news) == 0 ){ if (count($future_news) == 0 ){