add imgurl
This commit is contained in:
@@ -33,7 +33,8 @@ if( $posts ):
|
|||||||
setup_postdata( $post );?>
|
setup_postdata( $post );?>
|
||||||
|
|
||||||
<div class="moread_card" id="moread_<?=$nr?>">
|
<div class="moread_card" id="moread_<?=$nr?>">
|
||||||
<img src="<?php echo get_the_post_thumbnail_url($post);?>" alt="<?the_title();?>">
|
<?$imgurl = IMGSERVER.'news/512x340/'.str_replace('https://vetandlife.ru/wp-content/uploads/', '', get_the_post_thumbnail_url($post, 'full'))?>
|
||||||
|
<img src="<?php echo $imgurl;?>" alt="<?the_title();?>">
|
||||||
<div class="moread_title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></div>
|
<div class="moread_title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></div>
|
||||||
<div class="moread_date"><?the_time('j F Y, G:i');?></div>
|
<div class="moread_date"><?the_time('j F Y, G:i');?></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ $nn = 0;?>
|
|||||||
<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(null, 'large'); ?>" alt="<?the_title();?>">
|
<?$imgurl = IMGSERVER.'news/512x340/'.str_replace('https://vetandlife.ru/wp-content/uploads/', '', get_the_post_thumbnail_url(null, 'full'))?>
|
||||||
|
<a href="<?the_permalink();?>"><img class="mini-card-img" src="<?php echo $imgurl; ?>" alt="<?the_title();?>">
|
||||||
<?if( has_tag( 'видео' ) ):?>
|
<?if( has_tag( 'видео' ) ):?>
|
||||||
<span class="play-card"></span>
|
<span class="play-card"></span>
|
||||||
<?endif?>
|
<?endif?>
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ 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/');
|
||||||
|
|
||||||
|
define('IMGSERVER', 'https://img.vetandlife.ru/');
|
||||||
|
|
||||||
require ABSPATH.'/vendor/autoload.php';
|
require ABSPATH.'/vendor/autoload.php';
|
||||||
|
|
||||||
#отключаем автообновления
|
#отключаем автообновления
|
||||||
@@ -168,6 +170,18 @@ add_filter( 'single_template', function ( $single_template ) {
|
|||||||
}, PHP_INT_MAX, 2 );
|
}, PHP_INT_MAX, 2 );
|
||||||
|
|
||||||
|
|
||||||
|
#search
|
||||||
|
function my_search_order( $query ) {
|
||||||
|
if ($query->is_search) {
|
||||||
|
$query->set( 'order', 'DESC' );
|
||||||
|
$query->set( 'orderby', 'date' );
|
||||||
|
};
|
||||||
|
return $query;
|
||||||
|
};
|
||||||
|
|
||||||
|
add_filter( 'pre_get_posts', 'my_search_order' );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function kuri_set($name = null, $value = null) {
|
function kuri_set($name = null, $value = null) {
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ $nn = 0;?>
|
|||||||
<?if ( has_post_thumbnail() ) :?>
|
<?if ( has_post_thumbnail() ) :?>
|
||||||
<div class="mini-card-img">
|
<div class="mini-card-img">
|
||||||
<a href="<?the_permalink();?>">
|
<a href="<?the_permalink();?>">
|
||||||
<img class="mini-card-img" src="<?php echo get_the_post_thumbnail_url(null, 'large'); ?>" alt="<?the_title();?>">
|
<?$imgurl = IMGSERVER.'news/512x340/'.str_replace('https://vetandlife.ru/wp-content/uploads/', '', get_the_post_thumbnail_url(null, 'full'))?>
|
||||||
|
<img class="mini-card-img" src="<?=$imgurl;?>" alt="<?the_title();?>">
|
||||||
<?if( has_tag( 'видео' ) ):?>
|
<?if( has_tag( 'видео' ) ):?>
|
||||||
<span class="play-card"></span>
|
<span class="play-card"></span>
|
||||||
<?endif?>
|
<?endif?>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<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>, <?php the_time('j F Y, G:i');?>
|
||||||
</div>
|
</div>
|
||||||
<div class="post_info_sub post_info_social">
|
<div class="post_info_sub post_info_social">
|
||||||
<i class="fab fa-vk btn_soc_post"></i> <i class="fab fa-facebook-square btn_soc_post"></i> <i class="fab fa-telegram-plane btn_soc_post"></i>
|
<?php include get_template_directory().'/blocks/social-share.php';?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<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>, <?php the_time('j F Y, G:i');?>
|
||||||
</div>
|
</div>
|
||||||
<div class="post_panel_info_sub">
|
<div class="post_panel_info_sub">
|
||||||
<!--Поделиться <i class="fas fa-share-square btn_soc_post"></i>--> <i class="fab fa-vk btn_soc_post"></i> <i class="fab fa-facebook-square btn_soc_post"></i> <i class="fab fa-telegram-plane btn_soc_post"></i>
|
<!--Поделиться <i class="fas fa-share-square btn_soc_post"></i>--> <?php include get_template_directory().'/blocks/social-share.php';?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,93 +0,0 @@
|
|||||||
<?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);
|
|
||||||
$post_id = get_the_ID();
|
|
||||||
?>
|
|
||||||
|
|
||||||
<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>, <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';?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="fulltext">
|
|
||||||
<h1 class="post-h1"><?php wp_title('');?></h1>
|
|
||||||
<?$author = get_the_author();
|
|
||||||
if ( ! empty ( $author ) AND $author !== 'vetandlife.ru'):?>
|
|
||||||
<div class="post_author">
|
|
||||||
Автор: <?=the_author_posts_link()?>
|
|
||||||
</div>
|
|
||||||
<?endif?>
|
|
||||||
|
|
||||||
<?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>
|
|
||||||
|
|
||||||
<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>, <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';?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="promo-agregators">
|
|
||||||
<p>Свежие отраслевые новости на нашем канале в <span class="promo-telega"><a href="https://t.me/ViZHuvizh" target="_blank">Telegram</a></span></p>
|
|
||||||
<p>Добавьте «Ветеринарию и жизнь» в избранное в <a href="https://yandex.ru/news/?favid=254162793" target="_blank"><span class="promo_ya">Я</span><span style="font-weight: bold; color:black;">НДЕКС.НОВОСТИ</span></a></p>
|
|
||||||
<p>Подписывайтесь на канал «ВиЖ» в <b><a href="https://zen.yandex.ru/id/5ee3cb4d4954b90c587dec79" target="_blank"><span class="promo_ya">Я</span>НДЕКС.ДЗЕН</a></b></p>
|
|
||||||
</div>
|
|
||||||
<!--<p><small class="text-muted"><?php the_tags('');?></small></p> -->
|
|
||||||
<?//endwhile;?>
|
|
||||||
|
|
||||||
<?php include get_template_directory().'/blocks/yets.php';?>
|
|
||||||
|
|
||||||
<div id="tags">
|
|
||||||
<?php the_tags();?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php include get_template_directory().'/blocks/moread.php';?>
|
|
||||||
|
|
||||||
<div class="publ-to-main">
|
|
||||||
<button class="more_button" onclick="location.href='<?=get_site_url()?>/page/2'" type="button">
|
|
||||||
На главную</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php get_footer();?>
|
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category['0']->name;?></a></span>
|
<span class="post_link_category"><a href="<?=$category_link?>"><?=$category['0']->name;?></a></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="post_info_sub post_info_social">
|
<div class="post_info_sub post_info_social">
|
||||||
<i class="fab fa-vk btn_soc_post"></i> <i class="fab fa-facebook-square btn_soc_post"></i> <i class="fab fa-telegram-plane btn_soc_post"></i>
|
<?php include get_template_directory().'/blocks/social-share.php';?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@
|
|||||||
<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>, <?php the_time('j F Y, G:i');?>
|
||||||
</div>
|
</div>
|
||||||
<div class="post_panel_info_sub">
|
<div class="post_panel_info_sub">
|
||||||
<!--Поделиться <i class="fas fa-share-square btn_soc_post"></i>--> <i class="fab fa-vk btn_soc_post"></i> <i class="fab fa-facebook-square btn_soc_post"></i> <i class="fab fa-telegram-plane btn_soc_post"></i>
|
<!--Поделиться <i class="fas fa-share-square btn_soc_post"></i>--> <?php include get_template_directory().'/blocks/social-share.php';?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user