new page interviews

This commit is contained in:
argoexpert press
2024-06-11 12:54:22 +03:00
parent f871c62628
commit 6c9eb10fdc
4 changed files with 104 additions and 88 deletions

View File

@@ -1,28 +1,26 @@
<?php <?php get_header(); ?>
$args = array(
'posts_per_page' => 10, // Количество постов для вывода
'post_type' => 'post', // Тип постов для выборки (например, 'post', 'page', 'custom_post_type')
'orderby' => 'date', // Сортировка по дате
'order' => 'DESC', // Направление сортировки (DESC - по убыванию, ASC - по возрастанию)
'category_name' => get_queried_object()->slug
);
$counter = 0;
query_posts($args);
?>
<?php get_header() ?>
<div class="content-middle articles-wrapper"> <div class="content-middle articles-wrapper">
<?php get_template_part('partials/rubrics-mobile'); ?>
<? get_template_part('partials/rubrics-mobile'); ?> <div class="section-title desktop">
<div class="section-title border-top"> <?php if (is_category()) : ?>
<h1 class="section-title__title"><?= get_queried_object()->name ?></h1> <h1 class="section-title__title"><?= get_queried_object()->name ?></h1>
<?php endif; ?>
</div> </div>
<div class="articles-preview"> <div class="articles-preview">
<? if (have_posts()) : ?> <?php
<? while (have_posts()) : the_post(); ?> $paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1;
$counter = 0;
$args = array(
'post_type' => 'post',
'posts_per_page' => 10,
'paged' => $paged,
'category__in' => get_queried_object_id()
);
$query = new WP_Query($args);
?>
<? if ($query->have_posts()) : ?>
<? while ($query->have_posts()) : $query->the_post(); ?>
<? $counter++; <? $counter++;
$formatted_date = format_event_date(); ?> $formatted_date = format_event_date(); ?>
<a href="<? the_permalink(); ?>"> <a href="<? the_permalink(); ?>">
@@ -57,6 +55,10 @@ query_posts($args);
<a href="<?= home_url(); ?>" class="articles-preview__show-next mobile">На главную</a> <a href="<?= home_url(); ?>" class="articles-preview__show-next mobile">На главную</a>
</div> </div>
<? custom_pagination(); ?> <? custom_pagination(); ?>
</div>
<?php custom_pagination(); ?>
</div> </div>
<?php <?php get_footer(); ?>
get_footer() ?>

View File

@@ -601,7 +601,7 @@ button {
margin-bottom: 5px; margin-bottom: 5px;
} }
.advert-item__contact-email, .advert-item__contact-email a{ .advert-item__contact-email {
color: var(--secondary); color: var(--secondary);
}.article-item { }.article-item {
padding: 1.2rem 1.25rem 0; padding: 1.2rem 1.25rem 0;
@@ -988,16 +988,6 @@ button {
margin-bottom: 14px; margin-bottom: 14px;
} }
sub {
vertical-align: sub;
font-size: smaller;
}
sup {
vertical-align: super;
font-size: smaller;
}
@media (max-width: 767px) { @media (max-width: 767px) {
.article-single { .article-single {
border-top: 1px solid var(--gray); border-top: 1px solid var(--gray);
@@ -1101,7 +1091,7 @@ sup {
flex-direction: column; flex-direction: column;
gap: 5px; gap: 5px;
} }
.contacts__block-email, .contacts__block-email a { .contacts__block-email {
color: var(--secondary); color: var(--secondary);
} }
@@ -1600,14 +1590,6 @@ sup {
color: #2f2f2f; color: #2f2f2f;
} }
.edition-title{
font-weight: 700;
font-size: 2rem;
line-height: 2.4rem;
}
@media (max-width: 767px) { @media (max-width: 767px) {
.about { .about {
padding: 1.5rem 0.5rem; padding: 1.5rem 0.5rem;
@@ -1632,37 +1614,49 @@ sup {
} }
} }
.banner--header { .banner--header {
display: block; height: 12rem;
max-width: 1440px; display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
width: 100%; width: 100%;
margin: 0 auto;
overflow: hidden; overflow: hidden;
} }
.banner--header img {
min-height: 100%;
max-height: 100%;
}
.banner--header IMG{ .banner--header a {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
width: 100%; width: 100%;
height: auto; height: 100%;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
} }
@media (max-width: 767px) { @media (max-width: 767px) {
.banner--header { .banner--header {
display: block; height: 8rem;
max-width: 767px; position: relative;
width: 100%;
/* height: 8rem;
position: relative; */
} }
.banner--header img { .banner--header img {
width: 100%; position: absolute;
height: auto;
/*position: absolute;
left: 50%; left: 50%;
top: 50%; top: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
max-height: 100%;*/ max-height: 100%;
} }
}.breadcrumbs { }.breadcrumbs {
background: #fff; background: #fff;
@@ -2557,19 +2551,26 @@ h3,
} }
.rating { .rating {
margin-right: 12px; padding: 15px;
margin: 5px;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
border-radius: 50%;
width: 50px;
height: 50px;
max-width: 50px;
max-height: 50px;
background-color: var(--secondary);
color: white;
} }
.lang-switch{
font-weight: bold;
font-size: 1.2em;
}
.lang-switch a{
color: #ff6900;
}
@media (max-width: 768px) { @media (max-width: 768px) {
.nav { .nav {
display: grid; display: grid;
@@ -2584,15 +2585,6 @@ h3,
.nav .menu-item:nth-child(2n - 2) { .nav .menu-item:nth-child(2n - 2) {
justify-self: right; justify-self: right;
} }
.rating {
margin-right: 0;
}
.lang-switch{
font-size: 1em;
}
} }
.menu-item a { .menu-item a {
@@ -3278,7 +3270,6 @@ a.pagination__item:hover {
} }
.articles-preview__show-next { .articles-preview__show-next {
color: var(--secondary);
padding: 1.8rem 0 1.7rem; padding: 1.8rem 0 1.7rem;
grid-column: span 2; grid-column: span 2;
width: 100%; width: 100%;
@@ -3286,10 +3277,11 @@ a.pagination__item:hover {
border-top: 0.1rem solid var(--gray); border-top: 0.1rem solid var(--gray);
margin-top: -1px; margin-top: -1px;
font-family: 'Raleway', sans-serif; font-family: 'Raleway', sans-serif;
font-weight: 700;
-webkit-transition: 0.3s; -webkit-transition: 0.3s;
transition: 0.3s; transition: 0.3s;
font-size: 2rem; font-size: 1.3rem;
display: -webkit-box; display: -webkit-box;
display: -ms-flexbox; display: -ms-flexbox;
display: flex; display: flex;
@@ -3368,6 +3360,10 @@ a.pagination__item:hover {
gap: 1.5rem; gap: 1.5rem;
left: 3.9rem; left: 3.9rem;
bottom: 1.8rem; bottom: 1.8rem;
background: rgba(0, 0, 0, 0.5); /* Черный фон с 50% прозрачностью */
border-radius: 0.5rem; /* закруглим углы */
width: 200px;
padding-left: 4px;
} }
.banner-left { .banner-left {

View File

@@ -89,7 +89,6 @@
} }
.articles-preview__show-next { .articles-preview__show-next {
color: var(--secondary);
padding: 1.8rem 0 1.7rem; padding: 1.8rem 0 1.7rem;
grid-column: span 2; grid-column: span 2;
width: 100%; width: 100%;
@@ -97,9 +96,9 @@
border-top: 0.1rem solid var(--gray); border-top: 0.1rem solid var(--gray);
margin-top: -1px; margin-top: -1px;
font-family: 'Raleway', sans-serif; font-family: 'Raleway', sans-serif;
font-weight: 700;
transition: 0.3s; transition: 0.3s;
font-size: 2rem; font-size: 1.3rem;
display: flex; display: flex;
justify-content: center; justify-content: center;
} }
@@ -163,6 +162,10 @@
gap: 1.5rem; gap: 1.5rem;
left: 3.9rem; left: 3.9rem;
bottom: 1.8rem; bottom: 1.8rem;
background: rgba(0, 0, 0, 0.5); /* Черный фон с 50% прозрачностью */
border-radius: 0.5rem; /* закруглим углы */
width: 200px;
padding-left: 4px;
} }
.banner-left { .banner-left {

View File

@@ -1053,6 +1053,7 @@ add_filter('template_include', 'use_custom_template_for_en_subcategories');
} }
/**
function add_custom_admin_menu() { function add_custom_admin_menu() {
add_menu_page( add_menu_page(
'Update Posts Categories', // Заголовок страницы 'Update Posts Categories', // Заголовок страницы
@@ -1063,6 +1064,20 @@ function add_custom_admin_menu() {
); );
} }
add_action('admin_menu', 'add_custom_admin_menu');*/
function add_custom_admin_menu() {
add_submenu_page(
'tools.php', // Родительское меню (в данном случае "Инструменты")
'Update Posts Categories', // Заголовок страницы
'Update Categories EN', // Текст меню
'manage_options', // Возможность доступа (только администраторы)
'update-categories', // Уникальный идентификатор страницы
'update_categories_callback' // Функция для отображения контента страницы
);
}
add_action('admin_menu', 'add_custom_admin_menu'); add_action('admin_menu', 'add_custom_admin_menu');