add mobile media css

This commit is contained in:
2021-09-24 23:18:38 +03:00
parent 80da45b1d7
commit b2e941fa06
9 changed files with 376 additions and 24 deletions

32
blocks/archive.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
$posts = get_posts( array(
'numberposts' => 1,
'category' => 19, // 19 - архив газеты
'orderby' => 'date',
'order' => 'DESC',
'include' => array(),
'exclude' => array(),
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );
# вывод поста
if( $posts ):
foreach($posts as $post):
setup_postdata( $post );
?>
<div class="right_archive">
<img width="280" class="right_archive_img" src="<?php echo get_the_post_thumbnail_url($post, 'left-thumb');?>" alt="<?the_title();?>">
<div class="right_archive_text"><a href="<?php the_permalink(); ?>">Читать газету:<br><?php the_title();?></a></div>
</div>
<?php endforeach;
wp_reset_postdata();
endif;

View File

@@ -10,6 +10,12 @@ $posts = get_posts( array(
'meta_key' => '',
'meta_value' =>'',
'post_type' => 'post',
'meta_query' => array(
array(
'key' => '_thumbnail_id',
//'compare' => 'EXISTS'
)
),
'suppress_filters' => true, // подавление работы фильтров изменения SQL запроса
) );

View File

@@ -1,6 +1,6 @@
<?php $posts = get_posts( array(
'numberposts' => 4,
'category' => 22, // пока тольео события
'category' => $category_id, // текущая рубрика
'orderby' => 'date',
'order' => 'DESC',
'include' => array(),

View File

@@ -9,7 +9,12 @@ $nn = 0;?>
<div id="content">
<div id="content">
<ul id="nav_content">
<li><a href="http://beta.vetandlife.ru">Главная</li>
<li> - <?single_cat_title()?></li>
</ul>
<h1 class="my-4"><?=single_cat_title()?></h1>
@@ -26,7 +31,7 @@ $nn = 0;?>
<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 class="news_date"><?the_time('j F Y, G:i');?></div>>
</div>
</div>
@@ -58,6 +63,14 @@ $nn = 0;?>
<?php endif;?>
<?php if ( $wp_query->max_num_pages > 1 ) : ?><div class="pagination-wrapper"><?php the_posts_pagination( array(
'prev_text' => __( 'Предыдущая', 'quidus' ),
'next_text' => __( 'Следующая', 'quidus' ),
'end_size' => 2,
'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'quidus' ) . ' </span>',
) );
?></div><?php endif;?>
</div> <!-- end content -->

View File

@@ -42,6 +42,8 @@
<div class="soc_btn soc_instagram"></div> -->
</div>
<?php include get_template_directory().'/blocks/archive.php';?>
<div id="form_subscript">
<script src="//web.webformscr.com/apps/fc3/build/loader.js" async sp-form-id="caf123c41c347524b52869629e2a958536e65900b89bb2f72592f6e4796d554e"></script>
</div>
@@ -52,24 +54,56 @@
<div id="footer_menu">
<?php wp_footer(); ?>
<?php wp_nav_menu( array(
<div class="footer_sub">
<?php wp_nav_menu( array(
'menu_class'=>'menu_footer',
'theme_location'=>'top'
));?>
</div>
<div id="footer_up">
<a href="#main">навверх</a>
<a href="#main">наверх&nbsp;&nbsp;<i class="fas fa-chevron-up"></i></a>
</div>
</div>
<div id="footer_info">
<div id="footer_qr">
<img src = "<?=get_stylesheet_directory_uri()?>/pub/qr.png" />
<p class="vazh">Важно</p>
</div>
<div id="header-contact">
<div id="head_tel"><a href="tel:79250634">+7 (495) 925 06 34</a></div>
<div id="head_mail"><a href="mailto:info@vetandlife.ru">info@vetandlife.ru</a></div>
</div>
<div id="footer_logo">
<a href="<?php echo home_url(); ?>"><img src = "<?=get_stylesheet_directory_uri()?>/pub/logo/vij_150.jpg" alt = "Ветеринария и жизнь. Газета и сайт" /></a>
</div>
<div id="footer_subscript">
<button class="sub_button">Газета ВиЖ. Оформить подписку</button>
</div>
<div id="socials_footer">
<a href="https://vk.com/vizhuvizh" target="_blank"><i style="color: #3B83B5;" class="fab fa-vk btn_soc"></i></a>
<a href="https://www.facebook.com/vetandlife/" target="_blank"><i style="color: #3B83B5;" class="fab fa-facebook-square 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.instagram.com/vet_and_life/?igshid=14wtpyo4zusm7" target="_blank"><i style="color: orange;" class="fab fa-instagram btn_soc"></i></a>
</div>
</div>
<div id="footer_2">
<div id="copy">© Ветеринария и жизнь 2021</div>
<ul id="svid">
<li>Свидетельство о регистрации СМИ</li>
<li>Политика конфидициальности</li>
</ul>
</div>
<div id="footer_3">
<div id="rating"><span class="rating">12+</span></div>
<div id="pere">При перепечатке и использовании информации с сайта «Ветеринария и жизнь» активная ссылка на использованный материал обязательна. При использовании материалов в печатных СМИ указывать источник — «Ветеринария и жизнь»</div>
</div>
<div id="copy">© Ветеринария и жизнь 2021</div>
Свидетельство о регистрации СМИ <a href="">Политика конфидициальности</a>
<div id="pere"><span id="rating">12+</span> При перепечатке и использовании информации с сайта «Ветеринария и жизнь» активная ссылка на использованный материал обязательна. При использовании материалов в печатных СМИ указывать источник — «Ветеринария и жизнь»</div>
</footer>

View File

@@ -30,7 +30,8 @@
<div id="head_mail"><a href="mailto:info@vetandlife.ru">info@vetandlife.ru</a></div>
</div>
<?=get_search_query();?>
<ul id="header_icons">
<li class="btn_search"></li>
<li class="btn_rss"></li>

View File

@@ -10,8 +10,16 @@ $nn = 0;?>
<?php $query = new WP_Query(
array('category__not_in' => array(2, 18 ,44)
)); # фильтруем рубрики
array(
'category__not_in' => array(2, 15, 18 ,44, 1028),
'meta_query' => array(
array(
'key' => '_thumbnail_id',
//'compare' => 'EXISTS'
)
)
)
); # фильтруем рубрики
?>
<div id="content">

View File

@@ -1,38 +1,57 @@
<?php get_header();?>
<div>
<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);
?>
<ul id="nav_content">
<li><a href="http://beta.vetandlife.ru">Главная</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>, <?php the_time('j F Y, G:i');?>
</div>
<div class="post_info_sub">
<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>
</div>
</div>
<h1 class="my-4"><?php wp_title('');?></h1>
<?$author = the_author();
if ( ! empty ( $author ) ):?>
<?$author = get_the_author();
if ( ! empty ( $author ) AND $author !== 'vetandlife.ru'):?>
<div class="post_author">
Автор: <?php $author; ?>
Автор: <?php the_author(); ?>
</div>
<?endif?>
<?endif?>
<div class="publ_expert"><?php the_excerpt();?></div>
<img class="img-fluid rounded" src="<?php echo get_the_post_thumbnail_url(null, 'full');?>" alt="<?the_title();?>">
<div class="post_img_title"><?the_post_thumbnail_caption()?></div>
<?if ( has_post_thumbnail() ) :?>
<img class="img-fluid rounded" src="<?php echo get_the_post_thumbnail_url(null, 'full');?>" alt="<?the_title();?>">
<div class="post_img_title"><?the_post_thumbnail_caption()?></div>
<?endif?>
<?the_content();?>
<!--<p><small class="text-muted"><?php the_tags('');?></small></p> -->
<?//endwhile;?>
<?//endwhile;?>
<?php include get_template_directory().'/blocks/yets.php';?>
<div id="tags">
<?php the_tags();?>
</div>
<div class="post_panel_info">
<div class="post_panel_info_sub">

247
style.css
View File

@@ -90,6 +90,9 @@ a{
display: flex;
flex: 1;
}
#main > article {
flex: 1;
}
@@ -101,12 +104,14 @@ a{
#main > #left {
order: -1;
}
#left{
max-width: 330px;
display: flex;
flex-direction: column;
margin-right: 28px;
border-right: 28px solid #F2F2F2;
}
@@ -115,7 +120,8 @@ a{
max-width: 330px;
display: flex;
flex-direction: column;
border-left: 1px solid #E9EAEB;
padding-left: 12px;
}
header{
@@ -137,6 +143,105 @@ a{
}
#footer_up{
width: 20%;
text-align: right;
}
#footer_info{
display: flex;
margin-bottom: 8px;
}
#footer_qr{
width: 300px;
margin-right: 12px;
text-align: center;
}
#footer_subscript{
margin-left: 32px;
margin-right: 22px;
margin-top: 12px;
}
#footer_logo{
margin-left: 12px;
margin-right: 32px;
width: 150px;
}
#footer_social{
margin-left: 12px;
margin-right: 12px;
}
.sub_button {
background: #F18129;
border-radius: 55px;
border: 1px solid #F18129;
color: white;
padding: 10px 28px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
font-size: 11px;
}
.vazh{
font-size: 9px;
text-transform: uppercase;
letter-spacing: 0.45em;
}
#footer_2{
display: flex;
}
#footer_3{
display: flex;
margin-top: 12px;
}
#rating{
width: 20%;
text-align: right;
margin-right: 8px;
margin-top: 12px;
}
#pere{
width: 40%;
font-size: 12px;
line-height: 150%;
color: #909294;
}
#copy{
color: #171717;
font-size: 13px;
line-height: 150%;
margin-right: 8px;
width: 300px;
text-align: center;
}
#svid{
display: flex;
color: #444444;
font-size: 13px;
line-height: 150%;
}
#svid li{
margin-right: 18px;
}
/** - menus -- */
ul.menu_main{
display: flex;
@@ -213,6 +318,8 @@ a{
#header-contact{
display: flex;
flex-direction: column;
margin-top: 12px;
margin-right: 12px;
}
/* +7 (495) 925 06 34 info@vetandlife.ru */
@@ -246,7 +353,41 @@ a{
}
#content{
margin-right: 58px;
margin-left: 58px;
padding-bottom: 28px;
max-width: 880px;
}
#content p{
margin-top: .5em; /* Отступ сверху */
margin-bottom: 1em; /* Отступ снизу */
}
#content IMG{
max-width: 700px;
}
.page-numbers {
display: inline-block;
padding: 5px 10px;
margin: 0 2px 0 0;
border: 1px solid #eee;
line-height: 1;
text-decoration: none;
border-radius: 2px;
font-weight: 600;
}
.page-numbers.current,
a.page-numbers:hover {
background: #f9f9f9;
}
h1{
font-family: 'GrtskPeta';
@@ -262,6 +403,10 @@ a{
grid-gap: 2rem;
}
.mini-card{
max-width: 372px;
}
.mini-card-title{
font-family: 'GrtskPeta';
@@ -274,6 +419,24 @@ a{
}
#nav_content{
display: flex;
padding:0;
padding-bottom: 28px;
margin-top: 28px;
margin-bottom: 28px;
border-bottom: 1px solid #E9EAEB;
}
#nav_content li{
margin-right: 8px;
color: #909294;
}
#nav_content li a{
color: #909294;
}
.main-card{
padding-bottom: 22px;
margin: 8px 0 32px 0;
@@ -472,6 +635,21 @@ a{
font-size: 13px;
}
.right_archive{
margin-bottom: 22px;
}
.right_archive_img{
width: 280px;
}
.right_archive_text{
font-size: 15px;
line-height: 130%;
font-weight: bold;
}
.yets_rubric{
color: #F18129;
@@ -487,8 +665,8 @@ a{
.yets{
display: grid;
grid-template-columns: repeat(auto-fit, minmax(372px, 380px));
grid-gap: 1rem;
grid-template-columns: repeat(auto-fit, 320px);
margin-top: 8px;
margin-bottom: 28px;
}
@@ -523,6 +701,14 @@ a{
margin-bottom: 32px;
}
#tags{
color: #909294;
}
#tags a{
color: #909294;
}
/** socials */
#socials{
@@ -530,6 +716,11 @@ a{
margin: 0 12px 32px 12px;
}
#socials_footer{
display: flex;
margin: 12px 12px 32px 12px;
}
.btn_soc{
margin-right: 18px;
padding: 10px;
@@ -538,7 +729,7 @@ a{
}
.btn_soc_post{
margin-left:
margin-left: 12px;
}
@@ -549,9 +740,12 @@ a{
border: 1px solid #E9EAEB;
}
#rating{
.rating{
border-radius: 50%;
background-color: white;
padding: 8px;
color: white;
background: #ACACAC;
}
.soc_telegram{
@@ -574,6 +768,51 @@ a{
background: url(/wp-content/themes/vij/pub/icons/instagram-icon.png) no-repeat;
}
img-fluid{
text-align: center;
}
@media (max-width: 640px) {
#left{
display: none;
}
#mainmenu{
display: none;
}
#right{
display: none;
}
#nav_content{
display: none;
}
#header-contact{
display: none;
}
#content{
margin: 8px;
width: 540px;
}
.img-fluid{
max-width: 80%;
}
.post_info_social{
display: none;
}
}