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
$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() ?>
<?php get_header(); ?>
<div class="content-middle articles-wrapper">
<? get_template_part('partials/rubrics-mobile'); ?>
<div class="section-title border-top">
<?php get_template_part('partials/rubrics-mobile'); ?>
<div class="section-title desktop">
<?php if (is_category()) : ?>
<h1 class="section-title__title"><?= get_queried_object()->name ?></h1>
<?php endif; ?>
</div>
<div class="articles-preview">
<? if (have_posts()) : ?>
<? while (have_posts()) : the_post(); ?>
<?php
$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++;
$formatted_date = format_event_date(); ?>
<a href="<? the_permalink(); ?>">
@@ -57,6 +55,10 @@ query_posts($args);
<a href="<?= home_url(); ?>" class="articles-preview__show-next mobile">На главную</a>
</div>
<? custom_pagination(); ?>
</div>
<?php custom_pagination(); ?>
</div>
<?php
get_footer() ?>
<?php get_footer(); ?>

View File

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

View File

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

View File

@@ -1053,6 +1053,7 @@ add_filter('template_include', 'use_custom_template_for_en_subcategories');
}
/**
function add_custom_admin_menu() {
add_menu_page(
'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');