@ -0,0 +1,6 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
include_module('author'); |
||||||
|
include_component('author', 'author-archive'); |
||||||
|
|
||||||
|
?> |
@ -0,0 +1,211 @@ |
|||||||
|
<?php |
||||||
|
if (!defined('ABSPATH')) { |
||||||
|
exit; |
||||||
|
} |
||||||
|
|
||||||
|
function count_nested_replies($comment_id) { |
||||||
|
$count = 0; |
||||||
|
$replies = get_comments(array( |
||||||
|
'post_id' => get_the_ID(), |
||||||
|
'status' => 'approve', |
||||||
|
'parent' => $comment_id, |
||||||
|
'order' => 'ASC' |
||||||
|
)); |
||||||
|
|
||||||
|
if ($replies) { |
||||||
|
$count += count($replies); |
||||||
|
foreach ($replies as $reply) { |
||||||
|
$count += count_nested_replies($reply->comment_ID); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return $count; |
||||||
|
} |
||||||
|
|
||||||
|
if (post_password_required()) { |
||||||
|
return; |
||||||
|
} |
||||||
|
|
||||||
|
if (!is_user_logged_in()) { |
||||||
|
?> |
||||||
|
<div class="comment-block"> |
||||||
|
<p class="comment-block_text"> |
||||||
|
<a href="#modal"><?php pll_e('Войдите'); ?></a>, <?php pll_e('чтобы оставлять комментарии'); ?> |
||||||
|
</p> |
||||||
|
</div> |
||||||
|
<?php |
||||||
|
} |
||||||
|
|
||||||
|
$top_level_comments = get_comments(array( |
||||||
|
'post_id' => get_the_ID(), |
||||||
|
'status' => 'approve', |
||||||
|
'parent' => 0, |
||||||
|
'order' => 'ASC' |
||||||
|
)); |
||||||
|
|
||||||
|
if ($top_level_comments) { |
||||||
|
echo '<div class="comment-block_wrapper">'; |
||||||
|
|
||||||
|
foreach ($top_level_comments as $comment) { |
||||||
|
?> |
||||||
|
<div class="comment-block" id="comment-<?php echo $comment->comment_ID; ?>">
|
||||||
|
<div class="comment-user"> |
||||||
|
<?php echo get_avatar($comment, 50); ?> |
||||||
|
<div class="comment-user_text"> |
||||||
|
<h6><?php echo get_comment_author($comment); ?></h6>
|
||||||
|
<span><?php echo get_comment_date('d F Y', $comment); ?></span>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<p><?php echo get_comment_text($comment); ?></p>
|
||||||
|
<div class="comment-btns"> |
||||||
|
<button class="reply-to-comment" data-comment-id="<?php echo $comment->comment_ID; ?>" data-post-id="<?php echo get_the_ID(); ?>" data-reply-to="<?php echo esc_attr(get_comment_author($comment)); ?>">
|
||||||
|
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||||
|
<path d="M9.5 3H3.25C2.00736 3 1 4.00736 1 5.25V5.25C1 6.49264 2.00736 7.5 3.25 7.5H3.5" stroke="#666666"></path> |
||||||
|
<path d="M7 0.5L9.5 3L7 5.5" stroke="#666666"></path> |
||||||
|
</svg> |
||||||
|
<?php pll_e('Ответить'); ?> |
||||||
|
</button> |
||||||
|
<button class="comment-like-btn<?php echo is_user_liked_comment($comment->comment_ID) ? ' active' : ''; ?>" data-comment-id="<?php echo $comment->comment_ID; ?>">
|
||||||
|
<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||||
|
<path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z" <?php echo is_user_liked_comment($comment->comment_ID) ? 'stroke="#ff0000" fill="rgba(255, 0, 0, 0.7)"' : 'stroke="#666666"'; ?>></path>
|
||||||
|
</svg> |
||||||
|
<?php echo get_comment_likes_count($comment->comment_ID); ?> |
||||||
|
</button> |
||||||
|
<?php |
||||||
|
comment_reply_link(array( |
||||||
|
'reply_text' => pll__('Ответить'), |
||||||
|
'depth' => 1, |
||||||
|
'max_depth' => get_option('thread_comments_depth'), |
||||||
|
'before' => '<span style="display:none;">', |
||||||
|
'after' => '</span>', |
||||||
|
), $comment->comment_ID, get_the_ID()); |
||||||
|
?> |
||||||
|
</div> |
||||||
|
<div class="reply-form-container" id="reply-form-<?php echo $comment->comment_ID; ?>" style="display: none;"></div>
|
||||||
|
</div> |
||||||
|
<?php |
||||||
|
|
||||||
|
$all_nested_replies = get_all_nested_replies($comment->comment_ID); |
||||||
|
|
||||||
|
if (!empty($all_nested_replies)) { |
||||||
|
$total_reply_count = count($all_nested_replies); |
||||||
|
?> |
||||||
|
<button class="answer-btn"> |
||||||
|
<svg width="15" height="10" viewBox="0 0 15 10" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||||
|
<path d="M14 1.41406L7.5 7.91406L1 1.41406" stroke="#76CE75" stroke-width="2"></path> |
||||||
|
</svg> |
||||||
|
<?php echo $total_reply_count; ?> |
||||||
|
<span> |
||||||
|
<?php echo ($total_reply_count == 1) ? pll__('ответ') : pll__('ответа'); ?> |
||||||
|
</span> |
||||||
|
</button> |
||||||
|
<?php |
||||||
|
|
||||||
|
foreach ($all_nested_replies as $reply) { |
||||||
|
?> |
||||||
|
<div class="comment-block answer-block" id="comment-<?php echo $reply->comment_ID; ?>">
|
||||||
|
<div class="comment-user"> |
||||||
|
<?php echo get_avatar($reply, 50); ?> |
||||||
|
<div class="comment-user_text"> |
||||||
|
<h6><?php echo get_comment_author($reply); ?></h6>
|
||||||
|
<span><?php echo get_comment_date('d F Y', $reply); ?></span>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<p><?php echo get_comment_text($reply); ?></p>
|
||||||
|
<div class="comment-btns"> |
||||||
|
<button class="reply-to-comment" data-comment-id="<?php echo $reply->comment_ID; ?>" data-post-id="<?php echo get_the_ID(); ?>" data-reply-to="<?php echo esc_attr(get_comment_author($reply)); ?>">
|
||||||
|
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||||
|
<path d="M9.5 3H3.25C2.00736 3 1 4.00736 1 5.25V5.25C1 6.49264 2.00736 7.5 3.25 7.5H3.5" stroke="#666666"></path> |
||||||
|
<path d="M7 0.5L9.5 3L7 5.5" stroke="#666666"></path> |
||||||
|
</svg> |
||||||
|
<?php pll_e('Ответить'); ?> |
||||||
|
</button> |
||||||
|
<button class="comment-like-btn<?php echo is_user_liked_comment($reply->comment_ID) ? ' active' : ''; ?>" data-comment-id="<?php echo $reply->comment_ID; ?>">
|
||||||
|
<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||||
|
<path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z" <?php echo is_user_liked_comment($reply->comment_ID) ? 'stroke="#ff0000" fill="rgba(255, 0, 0, 0.7)"' : 'stroke="#666666"'; ?>></path>
|
||||||
|
</svg> |
||||||
|
<?php echo get_comment_likes_count($reply->comment_ID); ?> |
||||||
|
</button> |
||||||
|
<?php |
||||||
|
comment_reply_link(array( |
||||||
|
'reply_text' => pll__('Ответить'), |
||||||
|
'depth' => 2, |
||||||
|
'max_depth' => get_option('thread_comments_depth'), |
||||||
|
'before' => '<span style="display:none;">', |
||||||
|
'after' => '</span>', |
||||||
|
), $reply->comment_ID, get_the_ID()); |
||||||
|
?> |
||||||
|
</div> |
||||||
|
<div class="reply-form-container" id="reply-form-<?php echo $reply->comment_ID; ?>" style="display: none;"></div>
|
||||||
|
</div> |
||||||
|
<?php |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
echo '</div>'; |
||||||
|
} |
||||||
|
|
||||||
|
function get_all_nested_replies($comment_id) { |
||||||
|
$all_replies = array(); |
||||||
|
|
||||||
|
$direct_replies = get_comments(array( |
||||||
|
'post_id' => get_the_ID(), |
||||||
|
'status' => 'approve', |
||||||
|
'parent' => $comment_id, |
||||||
|
'order' => 'ASC' |
||||||
|
)); |
||||||
|
|
||||||
|
$all_replies = array_merge($all_replies, $direct_replies); |
||||||
|
|
||||||
|
foreach ($direct_replies as $reply) { |
||||||
|
$deeper_replies = get_all_nested_replies_recursive($reply->comment_ID); |
||||||
|
$all_replies = array_merge($all_replies, $deeper_replies); |
||||||
|
} |
||||||
|
|
||||||
|
return $all_replies; |
||||||
|
} |
||||||
|
|
||||||
|
function get_all_nested_replies_recursive($comment_id) { |
||||||
|
$replies = get_comments(array( |
||||||
|
'post_id' => get_the_ID(), |
||||||
|
'status' => 'approve', |
||||||
|
'parent' => $comment_id, |
||||||
|
'order' => 'ASC' |
||||||
|
)); |
||||||
|
|
||||||
|
$all_replies = $replies; |
||||||
|
|
||||||
|
foreach ($replies as $reply) { |
||||||
|
$deeper_replies = get_all_nested_replies_recursive($reply->comment_ID); |
||||||
|
$all_replies = array_merge($all_replies, $deeper_replies); |
||||||
|
} |
||||||
|
|
||||||
|
return $all_replies; |
||||||
|
} |
||||||
|
|
||||||
|
if (is_user_logged_in()) { |
||||||
|
$commenter = wp_get_current_commenter(); |
||||||
|
$args = array( |
||||||
|
'fields' => array( |
||||||
|
'author' => '', |
||||||
|
'email' => '', |
||||||
|
'url' => '', |
||||||
|
'cookies' => '', |
||||||
|
), |
||||||
|
'comment_field' => '<div class="comment-form-comment"><textarea id="comment" name="comment" placeholder="' . pll__('Ваш комментарий') . '" required></textarea></div>', |
||||||
|
'title_reply' => pll__('Оставить комментарий'), |
||||||
|
'title_reply_to' => pll__('Ответить %s'), |
||||||
|
'class_submit' => 'comment-submit-btn', |
||||||
|
'submit_button' => '<button name="%1$s" type="submit" id="%2$s" class="%3$s">%4$s</button>', |
||||||
|
'submit_field' => '<div class="form-submit">%1$s %2$s</div>', |
||||||
|
'cancel_reply_link' => pll__('Отменить'), |
||||||
|
'id_form' => 'commentform', |
||||||
|
'id_submit' => 'submit', |
||||||
|
'title_reply_before' => '<h3 id="reply-title" class="comment-reply-title">', |
||||||
|
'title_reply_after' => '</h3>', |
||||||
|
); |
||||||
|
|
||||||
|
comment_form($args); |
||||||
|
} |
||||||
|
?> |
@ -0,0 +1,732 @@ |
|||||||
|
|
||||||
|
|
||||||
|
/* Where home */ |
||||||
|
.where-home { |
||||||
|
padding: 162px 0 37px; |
||||||
|
color: var(--background); |
||||||
|
} |
||||||
|
|
||||||
|
.authors h1{ |
||||||
|
font-size: 82px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 96px; |
||||||
|
color:#fff; |
||||||
|
margin-bottom: 41px; |
||||||
|
text-transform: uppercase; |
||||||
|
} |
||||||
|
|
||||||
|
.where-home h1 { |
||||||
|
font-size: 82px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 96px; |
||||||
|
margin-bottom: 41px; |
||||||
|
text-transform: uppercase; |
||||||
|
} |
||||||
|
|
||||||
|
.where-home p { |
||||||
|
max-width: 928px; |
||||||
|
color: #FFF; |
||||||
|
font-size: 36px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 40px; |
||||||
|
text-transform: uppercase; |
||||||
|
} |
||||||
|
/* Where home end */ |
||||||
|
|
||||||
|
/* Find us */ |
||||||
|
.find-us { |
||||||
|
color: var(--background); |
||||||
|
padding-bottom: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.find-us h2 { |
||||||
|
padding: 10px 0; |
||||||
|
font-size: 36px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 40px; |
||||||
|
text-transform: uppercase; |
||||||
|
margin-bottom: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.find-us ul { |
||||||
|
display: grid; |
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr)); |
||||||
|
gap: 36px; |
||||||
|
} |
||||||
|
|
||||||
|
.find-us h3 { |
||||||
|
font-size: 24px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 28px; |
||||||
|
margin-bottom: 8px; |
||||||
|
text-transform: uppercase; |
||||||
|
} |
||||||
|
|
||||||
|
.find-us p { |
||||||
|
font-size: 24px; |
||||||
|
font-weight: 500; |
||||||
|
line-height: 32px; |
||||||
|
} |
||||||
|
/* Find us end */ |
||||||
|
|
||||||
|
/* Location */ |
||||||
|
.location { |
||||||
|
padding-bottom: 35px; |
||||||
|
} |
||||||
|
|
||||||
|
.location h2 { |
||||||
|
padding: 10px 0; |
||||||
|
margin-bottom: 37px; |
||||||
|
text-align: right; |
||||||
|
font-size: 36px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 40px; |
||||||
|
text-transform: uppercase; |
||||||
|
color: var(--main_white); |
||||||
|
} |
||||||
|
|
||||||
|
.location iframe { |
||||||
|
height: 783px; |
||||||
|
width: 100%; |
||||||
|
border-radius: 64px; |
||||||
|
} |
||||||
|
/* Location end */ |
||||||
|
|
||||||
|
/* Sell form */ |
||||||
|
.sell-form { |
||||||
|
padding-bottom: 31px; |
||||||
|
} |
||||||
|
|
||||||
|
.sell-form__container { |
||||||
|
background: var(--main_white); |
||||||
|
border-radius: 64px; |
||||||
|
padding: 64px 105px 38px; |
||||||
|
color: var(--grey-black); |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
gap: 48px; |
||||||
|
} |
||||||
|
|
||||||
|
.sell-form h2 { |
||||||
|
font-size: 36px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 40px; |
||||||
|
text-transform: uppercase; |
||||||
|
} |
||||||
|
|
||||||
|
.sell-form p { |
||||||
|
text-transform: uppercase; |
||||||
|
font-size: 24px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 28px; |
||||||
|
} |
||||||
|
|
||||||
|
.sell-form form { |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
align-items: center; |
||||||
|
gap: 16px; |
||||||
|
} |
||||||
|
|
||||||
|
.sell-form form button { |
||||||
|
background: var(--main_black); |
||||||
|
padding: 11px 70px; |
||||||
|
color: var(--main_white); |
||||||
|
text-transform: uppercase; |
||||||
|
border-radius: 16px; |
||||||
|
font-size: 20px; |
||||||
|
font-weight: 600; |
||||||
|
line-height: 24px; |
||||||
|
border: 1px solid var(--main_black); |
||||||
|
} |
||||||
|
|
||||||
|
.sell-form form button:hover { |
||||||
|
background: var(--main_white); |
||||||
|
color: var(--main_black); |
||||||
|
} |
||||||
|
/* Sell form end */ |
||||||
|
|
||||||
|
/* Breadcrumb */ |
||||||
|
.breadcrumb { |
||||||
|
padding: 20px 0 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.breadcrumb .container { |
||||||
|
color: var(--main_white); |
||||||
|
font-size: 14px; |
||||||
|
font-weight: 500; |
||||||
|
line-height: 16px; |
||||||
|
} |
||||||
|
|
||||||
|
.breadcrumb a { |
||||||
|
display: inline; |
||||||
|
} |
||||||
|
/* Breadcrumb end */ |
||||||
|
|
||||||
|
/* Authors */ |
||||||
|
.authors { |
||||||
|
padding-bottom: 120px; |
||||||
|
} |
||||||
|
|
||||||
|
.authors h2 { |
||||||
|
font-weight: bold; |
||||||
|
font-size: 64px; |
||||||
|
line-height: 120%; |
||||||
|
color: white; |
||||||
|
text-transform: uppercase; |
||||||
|
margin-bottom: 36px; |
||||||
|
} |
||||||
|
|
||||||
|
.authors ul { |
||||||
|
display: flex; |
||||||
|
flex-wrap: wrap; |
||||||
|
align-items: stretch; |
||||||
|
justify-content: center; |
||||||
|
gap: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.authors li { |
||||||
|
background: #F5F5F5; |
||||||
|
border-radius: 48px; |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
align-items: center; |
||||||
|
text-align: center; |
||||||
|
width: calc(100% / 3 - 16px); |
||||||
|
} |
||||||
|
|
||||||
|
.authors a { |
||||||
|
padding: 52px 17px 57px; |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
display: flex; |
||||||
|
flex-direction: column; |
||||||
|
align-items: center; |
||||||
|
} |
||||||
|
|
||||||
|
.authors .main-img { |
||||||
|
width: 200px; |
||||||
|
height: 200px; |
||||||
|
border-radius: 50%; |
||||||
|
overflow: hidden; |
||||||
|
flex-shrink: 0; |
||||||
|
margin-bottom: 31px; |
||||||
|
} |
||||||
|
|
||||||
|
.authors .main-img img { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
object-fit: cover; |
||||||
|
} |
||||||
|
|
||||||
|
.authors-name { |
||||||
|
font-size: 24px; |
||||||
|
font-weight: bold; |
||||||
|
text-transform: uppercase; |
||||||
|
line-height: 28px; |
||||||
|
color: #121212; |
||||||
|
margin-bottom: 5px; |
||||||
|
} |
||||||
|
|
||||||
|
.authors-type { |
||||||
|
color: #121212; |
||||||
|
font-size: 24px; |
||||||
|
font-weight: 500; |
||||||
|
line-height: 32px; |
||||||
|
margin-bottom: 31px; |
||||||
|
} |
||||||
|
|
||||||
|
.authors p { |
||||||
|
color: #666666; |
||||||
|
font-weight: 500; |
||||||
|
font-size: 20px; |
||||||
|
line-height: 24px; |
||||||
|
} |
||||||
|
/* Authors end */ |
||||||
|
|
||||||
|
/* author-head */ |
||||||
|
.author-head { |
||||||
|
padding-bottom: 36px; |
||||||
|
} |
||||||
|
|
||||||
|
.author-head-content { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
gap: 31px; |
||||||
|
margin-bottom: 17.5px; |
||||||
|
} |
||||||
|
|
||||||
|
.author-head .main-img { |
||||||
|
width: 278px; |
||||||
|
height: 278px; |
||||||
|
flex-shrink: 0; |
||||||
|
border-radius: 48px; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
.author-head .main-img img { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
object-fit: cover; |
||||||
|
} |
||||||
|
|
||||||
|
.author-name { |
||||||
|
font-size: 24px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 28px; |
||||||
|
color: white; |
||||||
|
margin-bottom: 5px; |
||||||
|
text-transform: uppercase; |
||||||
|
} |
||||||
|
|
||||||
|
.author-type { |
||||||
|
font-size: 24px; |
||||||
|
font-weight: 500; |
||||||
|
line-height: 32px; |
||||||
|
color: white; |
||||||
|
margin-bottom: 5px; |
||||||
|
} |
||||||
|
|
||||||
|
.author-description { |
||||||
|
font-size: 24px; |
||||||
|
font-weight: 500; |
||||||
|
line-height: 32px; |
||||||
|
color: white; |
||||||
|
margin-bottom: 45px; |
||||||
|
} |
||||||
|
|
||||||
|
.author-head p { |
||||||
|
font-size: 20px; |
||||||
|
font-weight: 500; |
||||||
|
line-height: 24px; |
||||||
|
color: white; |
||||||
|
} |
||||||
|
|
||||||
|
.author-head h2 { |
||||||
|
font-size: 64px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 120%; |
||||||
|
color: white; |
||||||
|
} |
||||||
|
/* author-head end */ |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Home */ |
||||||
|
.home { |
||||||
|
padding: 140px 0 68px; |
||||||
|
} |
||||||
|
|
||||||
|
.home-title { |
||||||
|
font-size: 82px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 96px; |
||||||
|
color: var(--main_white); |
||||||
|
margin-bottom: 16px; |
||||||
|
} |
||||||
|
|
||||||
|
.home-description { |
||||||
|
font-size: 32px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 40px; |
||||||
|
color: var(--main_white); |
||||||
|
text-transform: uppercase; |
||||||
|
margin-bottom: 68px; |
||||||
|
} |
||||||
|
|
||||||
|
.home-swp { |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
|
||||||
|
.home-swp__btn { |
||||||
|
position: absolute; |
||||||
|
bottom: 22px; |
||||||
|
left: 50%; |
||||||
|
transform: translateX(-50%); |
||||||
|
z-index: 2; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
gap: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.home-swp__btn button { |
||||||
|
border: 1px solid var(--main_black); |
||||||
|
background: var(--main_white); |
||||||
|
width: 56px; |
||||||
|
height: 56px; |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: center; |
||||||
|
border-radius: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.home-swp .swiper-slide:not(.swiper-slide-active) { |
||||||
|
height: 0; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
|
||||||
|
.home-card { |
||||||
|
border-radius: 60px; |
||||||
|
overflow: hidden; |
||||||
|
display: flex; |
||||||
|
align-items: flex-start; |
||||||
|
gap: 24px; |
||||||
|
position: relative; |
||||||
|
} |
||||||
|
|
||||||
|
.home-card.bg-yellow { |
||||||
|
background: var(--orange_80); |
||||||
|
} |
||||||
|
|
||||||
|
.home-card.bg-green { |
||||||
|
background: var(--green_90); |
||||||
|
} |
||||||
|
|
||||||
|
.home-card.bg-violet { |
||||||
|
background: var(--violet_90); |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__img { |
||||||
|
width: 395px; |
||||||
|
border-radius: 60px; |
||||||
|
overflow: hidden; |
||||||
|
height: 393px; |
||||||
|
flex-shrink: 0; |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__img img { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
object-fit: cover; |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__content { |
||||||
|
padding: 32px 79px 0 0; |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__content-title { |
||||||
|
font-size: 36px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 40px; |
||||||
|
text-transform: uppercase; |
||||||
|
max-width: 660px; |
||||||
|
margin-bottom: 10px; |
||||||
|
color: var(--interface_title); |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__content-description { |
||||||
|
color: var(--interface_title); |
||||||
|
margin-bottom: 10px; |
||||||
|
font-size: 20px; |
||||||
|
font-weight: 500; |
||||||
|
line-height: 24px; |
||||||
|
display: -webkit-box; |
||||||
|
-webkit-line-clamp: 3; |
||||||
|
-webkit-box-orient: vertical; |
||||||
|
overflow: hidden; |
||||||
|
text-overflow: ellipsis; |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__content-body { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
flex-wrap: wrap; |
||||||
|
gap: 12px; |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__content-body__alerts { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
flex-wrap: wrap; |
||||||
|
gap: 12px; |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__content-body__alerts li { |
||||||
|
background: var(--interface_hover); |
||||||
|
color: var(--background); |
||||||
|
border-radius: 16px; |
||||||
|
padding: 6px 8px; |
||||||
|
font-size: 16px; |
||||||
|
font-weight: 500; |
||||||
|
line-height: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__content-body__day { |
||||||
|
color: var(--interface_hover); |
||||||
|
font-size: 14px; |
||||||
|
font-weight: 500; |
||||||
|
line-height: 16px; |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__content-body__time { |
||||||
|
font-size: 14px; |
||||||
|
font-weight: 500; |
||||||
|
line-height: 16px; |
||||||
|
color: var(--interface_hover); |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__content-body__data { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
gap: 12px; |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__content-body__data>div { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
gap: 4px; |
||||||
|
font-size: 14px; |
||||||
|
font-weight: 500; |
||||||
|
line-height: 16px; |
||||||
|
color: var(--interface_hover); |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__content-body__data>div .main-img { |
||||||
|
width: 32px; |
||||||
|
height: 32px; |
||||||
|
border-radius: 50%; |
||||||
|
object-fit: cover; |
||||||
|
} |
||||||
|
|
||||||
|
.home-card__content-body__link { |
||||||
|
border: 1px solid #000000; |
||||||
|
border-radius: 28px; |
||||||
|
background: var(--main_white); |
||||||
|
position: absolute; |
||||||
|
right: 37px; |
||||||
|
bottom: 26px; |
||||||
|
padding: 8.5px 16px 12.5px; |
||||||
|
font-style: 20px; |
||||||
|
font-weight: 500; |
||||||
|
line-height: 24px; |
||||||
|
} |
||||||
|
/* Home end */ |
||||||
|
|
||||||
|
|
||||||
|
/* Anons */ |
||||||
|
.anons { |
||||||
|
background: var(--main_white); |
||||||
|
border-radius: 60px; |
||||||
|
padding: 51px 0; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-theme__title { |
||||||
|
color: var(--main_black); |
||||||
|
font-size: 24px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 28px; |
||||||
|
text-transform: uppercase; |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-theme { |
||||||
|
margin-bottom: 60px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-theme ul { |
||||||
|
max-width: 1022px; |
||||||
|
display: flex; |
||||||
|
flex-wrap: wrap; |
||||||
|
gap: 12px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-theme ul a { |
||||||
|
font-size: 20px; |
||||||
|
font-weight: 600; |
||||||
|
line-height: 24px; |
||||||
|
color: var(--main_black); |
||||||
|
padding: 4px 24px; |
||||||
|
border: 1px solid #000; |
||||||
|
border-radius: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-theme ul a:hover, |
||||||
|
.anons-theme ul a.active { |
||||||
|
background: var(--main_black); |
||||||
|
color: var(--main_white); |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best { |
||||||
|
margin-bottom: 60px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__title { |
||||||
|
font-size: 36px; |
||||||
|
line-height: 40px; |
||||||
|
font-weight: bold; |
||||||
|
color: var(--main_black); |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card-wrap { |
||||||
|
display: grid; |
||||||
|
grid-template-columns: repeat(3, minmax(0, 1fr)); |
||||||
|
gap: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card { |
||||||
|
padding-top: 293px; |
||||||
|
border-radius: 48px; |
||||||
|
overflow: hidden; |
||||||
|
position: relative; |
||||||
|
z-index: 1; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card.light { |
||||||
|
padding-top: 0; |
||||||
|
border-radius: 0; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card .main-img { |
||||||
|
position: absolute; |
||||||
|
top: 0; |
||||||
|
left: 0; |
||||||
|
width: 100%; |
||||||
|
height: 360px; |
||||||
|
z-index: -1; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card .main-img img { |
||||||
|
width: 100%; |
||||||
|
height: 100%; |
||||||
|
object-fit: cover; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card.light .main-img { |
||||||
|
position: static; |
||||||
|
height: 265px; |
||||||
|
} |
||||||
|
.anons-best__card.light .main-img img { |
||||||
|
border-radius: 30px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card-alerts { |
||||||
|
position: absolute; |
||||||
|
top: 21px; |
||||||
|
left: 17px; |
||||||
|
width: calc(100% - 34px); |
||||||
|
display: flex; |
||||||
|
flex-wrap: wrap; |
||||||
|
gap: 7px; |
||||||
|
z-index: 1; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card-alerts li { |
||||||
|
padding: 6px 8px; |
||||||
|
font-size: 16px; |
||||||
|
line-height: 20px; |
||||||
|
font-weight: 500; |
||||||
|
color: var(--background); |
||||||
|
background: var(--main_black); |
||||||
|
border-radius: 30px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card-body { |
||||||
|
background: var(--accent-1); |
||||||
|
padding: 30px 17px 22px; |
||||||
|
border-radius: 48px 48px 0 0; |
||||||
|
color: var(--main_white); |
||||||
|
position: relative; |
||||||
|
height: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card.light .anons-best__card-body { |
||||||
|
background: transparent; |
||||||
|
color: var(--main_black); |
||||||
|
padding: 12px 0 34px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card-body__title { |
||||||
|
font-size: 28px; |
||||||
|
font-weight: bold; |
||||||
|
line-height: 32px; |
||||||
|
text-transform: uppercase; |
||||||
|
margin-bottom: 14px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card.light .anons-best__card-body__title { |
||||||
|
font-size: 26px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card-body__datas { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
flex-wrap: wrap; |
||||||
|
gap: 6px 10px; |
||||||
|
max-width: 264px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card.light .anons-best__card-body__datas { |
||||||
|
color: var(--placeholder); |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card-body__datas p { |
||||||
|
font-size: 14px; |
||||||
|
line-height: 16px; |
||||||
|
font-weight: 500; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card-body__datas ul { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
gap: 10px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card-body__datas ul li { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
gap: 4px; |
||||||
|
font-size: 14px; |
||||||
|
line-height: 16px; |
||||||
|
font-weight: 500; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card-body__datas ul .logo img { |
||||||
|
width: 24px; |
||||||
|
height: 24px; |
||||||
|
border-radius: 50%; |
||||||
|
object-fit: cover; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-article { |
||||||
|
margin-bottom: 40px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-article__title { |
||||||
|
font-size: 36px; |
||||||
|
line-height: 40px; |
||||||
|
font-weight: bold; |
||||||
|
color: var(--main_black); |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-article__card-wrap { |
||||||
|
display: grid; |
||||||
|
grid-template-columns: repeat(3, minmax(0, 1fr)); |
||||||
|
gap: 40px 25px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-article__more-link { |
||||||
|
display: flex; |
||||||
|
align-items: center; |
||||||
|
justify-content: center; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-article__more-link a { |
||||||
|
background: var(--accent-3); |
||||||
|
color: var(--main_white); |
||||||
|
border-radius: 20px; |
||||||
|
border: 1px solid var(--main_white); |
||||||
|
padding: 16px 24px; |
||||||
|
font-size: 20px; |
||||||
|
font-weight: 600; |
||||||
|
line-height: 24px; |
||||||
|
text-transform: uppercase; |
||||||
|
} |
||||||
|
/* Anons end */ |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,120 @@ |
|||||||
|
/* Стили для мобильных устройств */ |
||||||
|
@media only screen and (max-width: 576px) { |
||||||
|
.anons-best__title { |
||||||
|
font-size: 26px; |
||||||
|
line-height: 32px; |
||||||
|
margin-bottom: 12px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card { |
||||||
|
padding-top: 205px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card .main-img { |
||||||
|
height: 300px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card-body { |
||||||
|
padding: 20px 17px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card-body__title { |
||||||
|
font-size: 20px; |
||||||
|
line-height: 24px; |
||||||
|
margin-bottom: 16px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card.light .main-img { |
||||||
|
height: 197px; |
||||||
|
} |
||||||
|
|
||||||
|
.anons-best__card.light .anons-best__card-body__title { |
||||||
|
font-size: 20px; |
||||||
|
line-height: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.authors { |
||||||
|
padding-bottom: 138px; |
||||||
|
} |
||||||
|
|
||||||
|
.authors h2 { |
||||||
|
font-size: 32px; |
||||||
|
line-height: 38px; |
||||||
|
margin-bottom: 15px; |
||||||
|
} |
||||||
|
|
||||||
|
.authors li { |
||||||
|
border-radius: 24px; |
||||||
|
width: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
.authors a { |
||||||
|
padding: 32px 17px 52px; |
||||||
|
} |
||||||
|
|
||||||
|
.authors .main-img { |
||||||
|
width: 180px; |
||||||
|
height: 180px; |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.authors-name { |
||||||
|
font-size: 20px; |
||||||
|
line-height: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.authors-type { |
||||||
|
font-size: 18px; |
||||||
|
line-height: 24px; |
||||||
|
margin-bottom: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.authors p { |
||||||
|
font-size: 16px; |
||||||
|
line-height: 20px; |
||||||
|
} |
||||||
|
|
||||||
|
.author-head { |
||||||
|
padding-bottom: 15px; |
||||||
|
} |
||||||
|
|
||||||
|
.author-head-content { |
||||||
|
margin-bottom: 23px; |
||||||
|
} |
||||||
|
|
||||||
|
.author-head .main-img { |
||||||
|
width: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
.author-head h2 { |
||||||
|
font-size: 32px; |
||||||
|
line-height: 38px; |
||||||
|
} |
||||||
|
|
||||||
|
.author-name { |
||||||
|
font-size: 20px; |
||||||
|
line-height: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.author-type { |
||||||
|
font-size: 18px; |
||||||
|
line-height: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.author-description { |
||||||
|
font-size: 18px; |
||||||
|
line-height: 24px; |
||||||
|
margin-bottom: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.author-head p { |
||||||
|
font-size: 16px; |
||||||
|
line-height: 20px; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,44 @@ |
|||||||
|
/* Стили для планшетов */ |
||||||
|
@media only screen and (max-width: 992px) { |
||||||
|
|
||||||
|
.authors h2 { |
||||||
|
font-size: 48px; |
||||||
|
margin-bottom: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.authors li { |
||||||
|
border-radius: 32px; |
||||||
|
width: calc(50% - 12px); |
||||||
|
} |
||||||
|
|
||||||
|
.authors .main-img { |
||||||
|
margin-bottom: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.author { |
||||||
|
padding-bottom: 24px; |
||||||
|
} |
||||||
|
|
||||||
|
.author h2 { |
||||||
|
font-size: 48px; |
||||||
|
} |
||||||
|
|
||||||
|
.author-head-content { |
||||||
|
flex-direction: column; |
||||||
|
align-items: flex-start; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Стили для планшетов */ |
||||||
|
@media only screen and (max-width: 992px) { |
||||||
|
|
||||||
|
.author { |
||||||
|
padding: 188px 0 36px; |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} |
After Width: | Height: | Size: 225 B |
After Width: | Height: | Size: 216 KiB |
After Width: | Height: | Size: 167 KiB |
After Width: | Height: | Size: 261 KiB |
After Width: | Height: | Size: 261 KiB |
After Width: | Height: | Size: 247 KiB |
After Width: | Height: | Size: 429 KiB |
After Width: | Height: | Size: 458 B |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 190 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 676 B |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 439 B |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 389 B |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 246 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 246 B |
After Width: | Height: | Size: 244 B |
After Width: | Height: | Size: 246 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 458 B |
After Width: | Height: | Size: 460 B |
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,46 @@ |
|||||||
|
jQuery(document).ready(function ($) { |
||||||
|
$('#ajax-load-author').on('submit', function (e) { |
||||||
|
e.preventDefault(); |
||||||
|
var form = $(this); |
||||||
|
var currentPage = parseInt($('#page_num').val()); |
||||||
|
var totalPosts = parseInt(form.data('total')); |
||||||
|
var postsPerPage = 9; |
||||||
|
|
||||||
|
console.log('Current page before load:', currentPage); |
||||||
|
console.log('Total posts:', totalPosts); |
||||||
|
console.log('Posts loaded before request:', postsPerPage); |
||||||
|
|
||||||
|
var data = { |
||||||
|
action: 'get_author_posts', |
||||||
|
page_num: currentPage, |
||||||
|
author_id: form.data('author') |
||||||
|
}; |
||||||
|
|
||||||
|
console.log('Sending AJAX request with data:', data); |
||||||
|
|
||||||
|
$.ajax({ |
||||||
|
url: '/wp-admin/admin-ajax.php', |
||||||
|
type: 'POST', |
||||||
|
data: data, |
||||||
|
success: function (response) { |
||||||
|
console.log('AJAX response received'); |
||||||
|
$(".anons-article__card-wrap").append(response); |
||||||
|
|
||||||
|
$('#page_num').val(currentPage + 1); |
||||||
|
console.log('New page number:', currentPage + 1); |
||||||
|
|
||||||
|
// Считаем общее количество загруженных постов
|
||||||
|
var currentlyDisplayed = $('.anons-article__card-wrap .anons-best__card').length; |
||||||
|
console.log('Actually displayed posts:', currentlyDisplayed); |
||||||
|
|
||||||
|
if (currentlyDisplayed >= totalPosts) { |
||||||
|
console.log('Hiding load more button - all posts loaded'); |
||||||
|
form.hide(); |
||||||
|
} |
||||||
|
}, |
||||||
|
error: function (error) { |
||||||
|
console.error('AJAX error:', error); |
||||||
|
} |
||||||
|
}); |
||||||
|
}); |
||||||
|
});
|
@ -0,0 +1,48 @@ |
|||||||
|
// const homeSwp = new Swiper('.home-swp .swiper', {
|
||||||
|
// slidesPerView: 1,
|
||||||
|
// spaceBetween: 0,
|
||||||
|
// effect: 'fade',
|
||||||
|
// loop: true,
|
||||||
|
// navigation: {
|
||||||
|
// nextEl: '.home-swp__btn-next',
|
||||||
|
// prevEl: '.home-swp__btn-prev',
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
// const textsSwp = new Swiper('.texts-swp .swiper', {
|
||||||
|
// slidesPerView: 1,
|
||||||
|
// spaceBetween: 0,
|
||||||
|
// loop: true,
|
||||||
|
// effect: 'fade',
|
||||||
|
// navigation: {
|
||||||
|
// nextEl: '.texts-swp__next',
|
||||||
|
// prevEl: '.texts-swp__prev'
|
||||||
|
// },
|
||||||
|
// pagination: {
|
||||||
|
// el: ".texts-swp__pagination",
|
||||||
|
// clickable: true,
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
// comment
|
||||||
|
// let answerbtns = document.querySelectorAll('.answer-btn');
|
||||||
|
// let answerbtnicons = document.querySelectorAll('.answer-btn svg');
|
||||||
|
// let answerblocks = document.querySelectorAll('.answer-block');
|
||||||
|
|
||||||
|
// answerbtns.forEach((answerbtn, index) => {
|
||||||
|
// answerbtn.addEventListener('click', () => {
|
||||||
|
// let answerbtnicon = answerbtnicons[index];
|
||||||
|
// let answerblock = answerblocks[index];
|
||||||
|
|
||||||
|
// answerblock.classList.toggle('active');
|
||||||
|
// answerbtnicon.classList.toggle('active');
|
||||||
|
|
||||||
|
// let buttonText = answerbtn.querySelector('span');
|
||||||
|
// if (buttonText.textContent === 'Ответ') {
|
||||||
|
// buttonText.textContent = 'Свернуть';
|
||||||
|
// } else {
|
||||||
|
// buttonText.textContent = 'ответ';
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// comment
|
@ -0,0 +1,54 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
include_component('blog', 'featured-slider'); |
||||||
|
include_module('forms'); |
||||||
|
include_component('forms', 'discount'); |
||||||
|
|
||||||
|
$context = Timber::context(); |
||||||
|
|
||||||
|
$context['blog_title'] = get_field('blog_title', 'options'); |
||||||
|
$context['blog_desc'] = get_field('blog_desc', 'options'); |
||||||
|
$context['post_count'] = wp_count_posts()->publish; |
||||||
|
$context['total_pages'] = ceil($context['post_count'] / get_option('posts_per_page')); |
||||||
|
|
||||||
|
$context['sub_title'] = get_field('sub_title', 383); |
||||||
|
$context['sub_text'] = get_field('sub_text', 383); |
||||||
|
|
||||||
|
$authors = Timber::get_posts([ |
||||||
|
'post_type' => 'blog_author', |
||||||
|
'posts_per_page' => -1, |
||||||
|
'orderby' => 'menu_order', |
||||||
|
'order' => 'ASC', |
||||||
|
]); |
||||||
|
|
||||||
|
$authors_arr = iterator_to_array($authors); |
||||||
|
foreach ($authors_arr as $author) { |
||||||
|
$author_id = $author->ID; |
||||||
|
$query = new WP_Query([ |
||||||
|
'post_type' => 'post', |
||||||
|
'posts_per_page' => -1, |
||||||
|
'meta_query' => [ |
||||||
|
[ |
||||||
|
'key' => 'post_author', |
||||||
|
'value' => $author_id, |
||||||
|
'compare' => '=' |
||||||
|
] |
||||||
|
] |
||||||
|
]); |
||||||
|
$author->post_count = $query->found_posts; |
||||||
|
$author->position = get_field('post', $author_id); |
||||||
|
$author->posts = Timber::get_posts([ |
||||||
|
'post_type' => 'post', |
||||||
|
'posts_per_page' => -1, |
||||||
|
'meta_query' => [ |
||||||
|
[ |
||||||
|
'key' => 'post_author', |
||||||
|
'value' => $author_id, |
||||||
|
'compare' => '=' |
||||||
|
] |
||||||
|
] |
||||||
|
]); |
||||||
|
} |
||||||
|
$context['authors'] = $authors_arr; |
||||||
|
|
||||||
|
Timber::render('blog_author/author-archive.twig', $context); |
@ -0,0 +1,41 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
$context = Timber::get_context(); |
||||||
|
|
||||||
|
$author = Timber::get_post(); |
||||||
|
$author_id = $author->ID; |
||||||
|
|
||||||
|
|
||||||
|
$author->position = get_field('post', $author_id); |
||||||
|
|
||||||
|
$count_query = new WP_Query([ |
||||||
|
'post_type' => 'post', |
||||||
|
'post_status' => 'publish', |
||||||
|
'posts_per_page' => -1, |
||||||
|
'meta_query' => [ |
||||||
|
[ |
||||||
|
'key' => 'post_author', |
||||||
|
'value' => $author_id, |
||||||
|
'compare' => '=' |
||||||
|
] |
||||||
|
] |
||||||
|
]); |
||||||
|
$author->post_count = $count_query->found_posts; |
||||||
|
|
||||||
|
$author->posts = Timber::get_posts([ |
||||||
|
'post_type' => 'post', |
||||||
|
'post_status' => 'publish', |
||||||
|
'posts_per_page' => 9, |
||||||
|
'meta_query' => [ |
||||||
|
[ |
||||||
|
'key' => 'post_author', |
||||||
|
'value' => $author_id, |
||||||
|
'compare' => '=' |
||||||
|
] |
||||||
|
] |
||||||
|
]); |
||||||
|
|
||||||
|
$context['author'] = $author; |
||||||
|
$context['total_pages'] = ceil($author->post_count / 9); |
||||||
|
|
||||||
|
Timber::render('blog_author/author-single.twig', $context); |
@ -0,0 +1,35 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
include_module('author'); |
||||||
|
|
||||||
|
function get_author_posts() { |
||||||
|
$author_id = isset($_POST['author_id']) ? sanitize_text_field($_POST['author_id']) : ''; |
||||||
|
|
||||||
|
$all_posts = Timber::get_posts([ |
||||||
|
'post_type' => 'post', |
||||||
|
'post_status' => 'publish', |
||||||
|
'posts_per_page' => -1, |
||||||
|
'meta_query' => [ |
||||||
|
[ |
||||||
|
'key' => 'post_author', |
||||||
|
'value' => $author_id, |
||||||
|
'compare' => '=' |
||||||
|
] |
||||||
|
] |
||||||
|
]); |
||||||
|
|
||||||
|
if ($all_posts instanceof \Timber\PostQuery || $all_posts instanceof \Timber\PostCollection) { |
||||||
|
$all_posts = $all_posts->get_posts(); |
||||||
|
} |
||||||
|
|
||||||
|
$remaining_posts = array_slice($all_posts, 9); |
||||||
|
|
||||||
|
$context = Timber::context(); |
||||||
|
$context['posts'] = $remaining_posts; |
||||||
|
|
||||||
|
Timber::render('blog_author/author-posts-list.twig', $context); |
||||||
|
wp_die(); |
||||||
|
} |
||||||
|
|
||||||
|
add_action('wp_ajax_get_author_posts', 'get_author_posts'); |
||||||
|
add_action('wp_ajax_nopriv_get_author_posts', 'get_author_posts'); |
@ -0,0 +1,198 @@ |
|||||||
|
// comment
|
||||||
|
let answerbtns = document.querySelectorAll('.answer-btn'); |
||||||
|
let answerbtnicons = document.querySelectorAll('.answer-btn svg'); |
||||||
|
|
||||||
|
// При загрузке страницы проверяем активные кнопки
|
||||||
|
document.addEventListener('DOMContentLoaded', function() { |
||||||
|
// Для каждой кнопки ответов
|
||||||
|
answerbtns.forEach((answerbtn) => { |
||||||
|
// Находим родительский контейнер, чтобы искать ответы только для этого комментария
|
||||||
|
const buttonParent = answerbtn.parentElement; |
||||||
|
|
||||||
|
// Находим все блоки ответов для этого комментария (после текущей кнопки)
|
||||||
|
const answerBlocks = getRelatedAnswerBlocks(answerbtn); |
||||||
|
if (answerBlocks.length === 0) return; |
||||||
|
|
||||||
|
// Проверяем, должны ли быть ответы развернуты (если у кнопки или любого ответа есть класс active)
|
||||||
|
const shouldBeActive = answerbtn.querySelector('svg').classList.contains('active') ||
|
||||||
|
Array.from(answerBlocks).some(block => block.classList.contains('active')); |
||||||
|
|
||||||
|
if (shouldBeActive) { |
||||||
|
// Активируем все ответы только для этого комментария
|
||||||
|
answerBlocks.forEach(block => { |
||||||
|
block.classList.add('active'); |
||||||
|
}); |
||||||
|
|
||||||
|
// Обновляем состояние кнопки
|
||||||
|
answerbtn.querySelector('svg').classList.add('active'); |
||||||
|
|
||||||
|
// Обновляем текст кнопки
|
||||||
|
let buttonText = answerbtn.querySelector('span'); |
||||||
|
if (buttonText) { |
||||||
|
buttonText.textContent = 'Свернуть'; |
||||||
|
} |
||||||
|
} else { |
||||||
|
// Скрываем все ответы
|
||||||
|
answerBlocks.forEach(block => { |
||||||
|
block.classList.remove('active'); |
||||||
|
}); |
||||||
|
|
||||||
|
// Обновляем состояние кнопки
|
||||||
|
answerbtn.querySelector('svg').classList.remove('active'); |
||||||
|
|
||||||
|
// Обновляем текст кнопки в зависимости от количества ответов
|
||||||
|
let buttonText = answerbtn.querySelector('span'); |
||||||
|
if (buttonText) { |
||||||
|
const count = answerBlocks.length; |
||||||
|
buttonText.textContent = count === 1 ? 'ответ' : 'ответа'; |
||||||
|
} |
||||||
|
} |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
// Функция для получения блоков ответов, связанных с данной кнопкой
|
||||||
|
function getRelatedAnswerBlocks(answerBtn) { |
||||||
|
// Получаем следующий блок комментариев (если он есть)
|
||||||
|
let currentElement = answerBtn; |
||||||
|
let answerBlocks = []; |
||||||
|
|
||||||
|
// Собираем все блоки ответов до следующего основного комментария или кнопки ответов
|
||||||
|
while ((currentElement = currentElement.nextElementSibling) !== null) { |
||||||
|
if (currentElement.classList.contains('comment-block') && !currentElement.classList.contains('answer-block')) { |
||||||
|
// Достигли следующего основного комментария, прерываем сбор
|
||||||
|
break; |
||||||
|
} else if (currentElement.classList.contains('answer-btn')) { |
||||||
|
// Достигли следующей кнопки ответов, прерываем сбор
|
||||||
|
break; |
||||||
|
} else if (currentElement.classList.contains('answer-block')) { |
||||||
|
// Это блок ответа, добавляем в коллекцию
|
||||||
|
answerBlocks.push(currentElement); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
return answerBlocks; |
||||||
|
} |
||||||
|
|
||||||
|
// Обработчики нажатия на кнопки ответов
|
||||||
|
answerbtns.forEach((answerbtn) => { |
||||||
|
answerbtn.addEventListener('click', () => { |
||||||
|
// Получаем все блоки ответов для этого комментария
|
||||||
|
const answerBlocks = getRelatedAnswerBlocks(answerbtn); |
||||||
|
if (answerBlocks.length === 0) return; |
||||||
|
|
||||||
|
// Определяем, развернуты ли ответы сейчас
|
||||||
|
const isCurrentlyActive = answerbtn.querySelector('svg').classList.contains('active'); |
||||||
|
|
||||||
|
// Переключаем состояние
|
||||||
|
if (isCurrentlyActive) { |
||||||
|
// Скрываем все ответы
|
||||||
|
answerBlocks.forEach(block => { |
||||||
|
block.classList.remove('active'); |
||||||
|
}); |
||||||
|
|
||||||
|
// Обновляем состояние кнопки
|
||||||
|
answerbtn.querySelector('svg').classList.remove('active'); |
||||||
|
|
||||||
|
// Обновляем текст кнопки
|
||||||
|
let buttonText = answerbtn.querySelector('span'); |
||||||
|
if (buttonText) { |
||||||
|
const count = answerBlocks.length; |
||||||
|
buttonText.textContent = count === 1 ? 'ответ' : 'ответа'; |
||||||
|
} |
||||||
|
} else { |
||||||
|
// Показываем все ответы
|
||||||
|
answerBlocks.forEach(block => { |
||||||
|
block.classList.add('active'); |
||||||
|
}); |
||||||
|
|
||||||
|
// Обновляем состояние кнопки
|
||||||
|
answerbtn.querySelector('svg').classList.add('active'); |
||||||
|
|
||||||
|
// Обновляем текст кнопки
|
||||||
|
let buttonText = answerbtn.querySelector('span'); |
||||||
|
if (buttonText) { |
||||||
|
buttonText.textContent = 'Свернуть'; |
||||||
|
} |
||||||
|
} |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
// Обработка нажатия на кнопку "Ответить" на комментарий
|
||||||
|
document.addEventListener('DOMContentLoaded', function() { |
||||||
|
// Получаем все кнопки "Ответить" на странице
|
||||||
|
const replyButtons = document.querySelectorAll('.reply-to-comment'); |
||||||
|
|
||||||
|
// Добавляем обработчик на каждую кнопку
|
||||||
|
replyButtons.forEach(button => { |
||||||
|
button.addEventListener('click', function() { |
||||||
|
// Получаем ID комментария, на который отвечаем
|
||||||
|
const commentId = this.getAttribute('data-comment-id'); |
||||||
|
const postId = this.getAttribute('data-post-id'); |
||||||
|
const replyToName = this.getAttribute('data-reply-to'); |
||||||
|
|
||||||
|
// Получаем контейнер для формы ответа
|
||||||
|
const replyFormContainer = document.getElementById('reply-form-' + commentId); |
||||||
|
|
||||||
|
// Если форма уже открыта, скрываем её
|
||||||
|
if (replyFormContainer.style.display !== 'none') { |
||||||
|
replyFormContainer.style.display = 'none'; |
||||||
|
return; |
||||||
|
} |
||||||
|
|
||||||
|
// Скрываем все открытые формы ответов
|
||||||
|
document.querySelectorAll('.reply-form-container').forEach(container => { |
||||||
|
container.style.display = 'none'; |
||||||
|
}); |
||||||
|
|
||||||
|
// Клонируем основную форму комментариев
|
||||||
|
const originalForm = document.getElementById('commentform'); |
||||||
|
if (originalForm) { |
||||||
|
const clonedForm = originalForm.cloneNode(true); |
||||||
|
|
||||||
|
// Изменяем атрибуты формы для ответа
|
||||||
|
clonedForm.id = 'commentform-reply-' + commentId; |
||||||
|
|
||||||
|
// Добавляем скрытое поле с ID родительского комментария
|
||||||
|
const hiddenInput = document.createElement('input'); |
||||||
|
hiddenInput.type = 'hidden'; |
||||||
|
hiddenInput.name = 'comment_parent'; |
||||||
|
hiddenInput.value = commentId; |
||||||
|
clonedForm.appendChild(hiddenInput); |
||||||
|
|
||||||
|
// Изменяем заголовок формы
|
||||||
|
const formTitle = clonedForm.querySelector('.comment-reply-title'); |
||||||
|
if (formTitle) { |
||||||
|
formTitle.textContent = 'Ответить ' + replyToName; |
||||||
|
} |
||||||
|
|
||||||
|
// Добавляем кнопку отмены
|
||||||
|
const cancelButton = document.createElement('button'); |
||||||
|
cancelButton.type = 'button'; |
||||||
|
cancelButton.className = 'cancel-reply-btn'; |
||||||
|
cancelButton.textContent = 'Отменить'; |
||||||
|
cancelButton.addEventListener('click', function() { |
||||||
|
replyFormContainer.style.display = 'none'; |
||||||
|
}); |
||||||
|
|
||||||
|
// Добавляем кнопку отмены в форму
|
||||||
|
const submitContainer = clonedForm.querySelector('.form-submit'); |
||||||
|
if (submitContainer) { |
||||||
|
submitContainer.appendChild(cancelButton); |
||||||
|
} |
||||||
|
|
||||||
|
// Очищаем контейнер и добавляем клонированную форму
|
||||||
|
replyFormContainer.innerHTML = ''; |
||||||
|
replyFormContainer.appendChild(clonedForm); |
||||||
|
|
||||||
|
// Показываем форму
|
||||||
|
replyFormContainer.style.display = 'block'; |
||||||
|
|
||||||
|
// Фокусируемся на текстовой области
|
||||||
|
const textarea = clonedForm.querySelector('textarea'); |
||||||
|
if (textarea) { |
||||||
|
textarea.focus(); |
||||||
|
} |
||||||
|
} |
||||||
|
}); |
||||||
|
}); |
||||||
|
}); |
After Width: | Height: | Size: 439 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 246 B |
After Width: | Height: | Size: 389 B |
After Width: | Height: | Size: 244 B |
After Width: | Height: | Size: 391 B |
After Width: | Height: | Size: 246 B |
@ -0,0 +1,147 @@ |
|||||||
|
jQuery(document).ready(function ($) { |
||||||
|
$(".comment-btn button").on("click", function () { |
||||||
|
var postId = $(this).data("post-id"); |
||||||
|
var $button = $(this); |
||||||
|
|
||||||
|
$.ajax({ |
||||||
|
url: "/wp-admin/admin-ajax.php", |
||||||
|
type: "POST", |
||||||
|
data: { |
||||||
|
action: "add_post_like", |
||||||
|
post_id: postId, |
||||||
|
}, |
||||||
|
success: function (response) { |
||||||
|
if (response.error) { |
||||||
|
alert(response.error); |
||||||
|
window.location.href = "/wp-login.php"; |
||||||
|
return; |
||||||
|
} |
||||||
|
|
||||||
|
$(".comment-btn span").text(response.count); |
||||||
|
|
||||||
|
if (response.is_liked) { |
||||||
|
$button.addClass("active"); |
||||||
|
|
||||||
|
$button.find("svg path").attr({ |
||||||
|
fill: "rgba(255, 0, 0, 0.7)", |
||||||
|
stroke: "#ff0000", |
||||||
|
}); |
||||||
|
} else { |
||||||
|
$button.removeClass("active"); |
||||||
|
|
||||||
|
$button.find("svg path").attr({ |
||||||
|
fill: "rgb(18, 18, 18)", |
||||||
|
stroke: "#666666", |
||||||
|
}); |
||||||
|
} |
||||||
|
}, |
||||||
|
error: function (error) { |
||||||
|
if (error.responseJSON && error.responseJSON.data) { |
||||||
|
alert(error.responseJSON.data); |
||||||
|
window.location.href = "/wp-login.php"; |
||||||
|
} |
||||||
|
}, |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
$(document).on("click", ".comment-like-btn", function () { |
||||||
|
var commentId = $(this).data("comment-id"); |
||||||
|
var $button = $(this); |
||||||
|
|
||||||
|
$.ajax({ |
||||||
|
url: "/wp-admin/admin-ajax.php", |
||||||
|
type: "POST", |
||||||
|
data: { |
||||||
|
action: "add_comment_like", |
||||||
|
comment_id: commentId, |
||||||
|
}, |
||||||
|
success: function (response) { |
||||||
|
if (response.error) { |
||||||
|
alert(response.error); |
||||||
|
window.location.href = "/wp-login.php"; |
||||||
|
return; |
||||||
|
} |
||||||
|
|
||||||
|
if (response.is_liked) { |
||||||
|
$button |
||||||
|
.empty() |
||||||
|
.append( |
||||||
|
$( |
||||||
|
'<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z" stroke="#ff0000" fill="rgba(255, 0, 0, 0.7)"></path></svg>' |
||||||
|
) |
||||||
|
) |
||||||
|
.append(response.count); |
||||||
|
$button.addClass("active"); |
||||||
|
} else { |
||||||
|
$button |
||||||
|
.empty() |
||||||
|
.append( |
||||||
|
$( |
||||||
|
'<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z" stroke="#666666" fill="none"></path></svg>' |
||||||
|
) |
||||||
|
) |
||||||
|
.append(response.count); |
||||||
|
$button.removeClass("active"); |
||||||
|
} |
||||||
|
}, |
||||||
|
error: function (error) { |
||||||
|
if (error.responseJSON && error.responseJSON.data) { |
||||||
|
alert(error.responseJSON.data); |
||||||
|
window.location.href = "/wp-login.php"; |
||||||
|
} |
||||||
|
}, |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
|
function checkLikedPosts() { |
||||||
|
if (!document.body.classList.contains("logged-in")) { |
||||||
|
return; |
||||||
|
} |
||||||
|
|
||||||
|
$.ajax({ |
||||||
|
url: "/wp-admin/admin-ajax.php", |
||||||
|
type: "POST", |
||||||
|
data: { |
||||||
|
action: "check_user_likes", |
||||||
|
}, |
||||||
|
success: function (response) { |
||||||
|
if (response.error) { |
||||||
|
return; |
||||||
|
} |
||||||
|
|
||||||
|
try { |
||||||
|
var data = JSON.parse(response); |
||||||
|
|
||||||
|
if (data.posts && data.posts.length > 0) { |
||||||
|
for (var i = 0; i < data.posts.length; i++) { |
||||||
|
var $button = $('.comment-btn button[data-post-id="' + data.posts[i] + '"]'); |
||||||
|
$button.addClass("active"); |
||||||
|
$button.find("svg path").attr({ |
||||||
|
fill: "rgba(255, 0, 0, 0.7)", |
||||||
|
stroke: "#ff0000", |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if (data.comments && data.comments.length > 0) { |
||||||
|
for (var j = 0; j < data.comments.length; j++) { |
||||||
|
var $commentButton = $('.comment-like-btn[data-comment-id="' + data.comments[j] + '"]'); |
||||||
|
$commentButton.addClass("active"); |
||||||
|
|
||||||
|
$commentButton.find("svg path").attr({ |
||||||
|
fill: "rgba(255, 0, 0, 0.7)", |
||||||
|
stroke: "#ff0000", |
||||||
|
}); |
||||||
|
} |
||||||
|
} |
||||||
|
} catch (e) {} |
||||||
|
}, |
||||||
|
error: function (error) {}, |
||||||
|
}); |
||||||
|
} |
||||||
|
|
||||||
|
if (document.body.classList.contains("logged-in")) { |
||||||
|
checkLikedPosts(); |
||||||
|
} |
||||||
|
}); |
||||||
|
|
@ -0,0 +1,6 @@ |
|||||||
|
<?php |
||||||
|
|
||||||
|
include_module('author'); |
||||||
|
include_component('author', 'author-single'); |
||||||
|
|
||||||
|
?> |
@ -1,62 +1,89 @@ |
|||||||
{% extends 'layout.twig' %} |
{% extends 'layout.twig' %} |
||||||
|
|
||||||
|
|
||||||
{% block content %} |
{% block content %} |
||||||
|
|
||||||
<!-- Breadcrumb --> |
|
||||||
<section class="breadcrumb"> |
|
||||||
<div class="container"> |
|
||||||
<a href="{{ site.url }}">{{ function('pll_e', 'Главная') }}</a> / |
|
||||||
<a href="{{ site.url }}">{{ function('pll_e', 'Блог') }}</a> / |
|
||||||
<a href="{{ post.link }}">{{ post.name }}</a> |
|
||||||
</div> |
|
||||||
</section> |
|
||||||
<!-- Breadcrumb end --> |
|
||||||
|
|
||||||
<!-- Article home --> |
<!-- Breadcrumb --> |
||||||
<section class="article-home"> |
<section class="breadcrumb"> |
||||||
<div class="container"> |
<div class="container"> |
||||||
<h1>{{post.name}}</h1> |
<a href="{{ site.url }}">{{ function('pll_e', 'Главная') }}</a> / |
||||||
<div class="article-home__data"> |
<a href="{{ site.url }}">{{ function('pll_e', 'Блог') }}</a> / |
||||||
<ul class="article-home__data-alerts"> |
<a href="{{ post.link }}">{{ post.name }}</a> |
||||||
{% for category in post.categories %} |
</div> |
||||||
<li> |
</section> |
||||||
<a href="{{ category.link }}">{{ category.name }}</a> |
<!-- Breadcrumb end --> |
||||||
</li> |
|
||||||
{% endfor %} |
|
||||||
</ul> |
|
||||||
<p>{{post.date}}</p> |
|
||||||
<p>{{ function('pll_e', 'время чтения') }}: {{post.reading_time}}</p> |
|
||||||
|
|
||||||
{% if post.get_author_name %} |
|
||||||
<div class="user"> |
|
||||||
<img src="{{post.get_author_img}}"> |
|
||||||
<span>{{post.get_author_name}}</span> |
|
||||||
|
|
||||||
|
<!-- Article home --> |
||||||
|
<section class="article-home"> |
||||||
|
<div class="container"> |
||||||
|
<h1>{{post.name}}</h1> |
||||||
|
<div class="article-home__data"> |
||||||
|
<ul class="article-home__data-alerts"> |
||||||
|
{% for category in post.categories %} |
||||||
|
<li> |
||||||
|
<a href="{{ category.link }}">{{ category.name }}</a> |
||||||
|
</li> |
||||||
|
{% endfor %} |
||||||
|
</ul> |
||||||
|
<p>{{post.date}}</p> |
||||||
|
<p>{{ function('pll_e', 'время чтения') }}: {{post.reading_time}}</p> |
||||||
|
|
||||||
|
{% if post.get_author_name %} |
||||||
|
<div class="user"> |
||||||
|
<a href="{{ post.get_author_link }}"> |
||||||
|
<img src="{{post.get_author_img}}"> |
||||||
|
<span>{{post.get_author_name}}</span> |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
{% endif %} |
||||||
|
</div> |
||||||
|
<div class="article-home__card"> |
||||||
|
<img src="{{post.thumbnail.src}}" alt="{{post.thumbnail.alt}}"> |
||||||
</div> |
</div> |
||||||
{% endif %} |
|
||||||
</div> |
</div> |
||||||
<div class="article-home__card"> |
</section> |
||||||
<img src="{{post.thumbnail.src}}" alt="{{post.thumbnail.alt}}"> |
|
||||||
|
<!-- Article home end --> |
||||||
|
|
||||||
|
<!-- Article content --> |
||||||
|
<div class="article-content"> |
||||||
|
<div class="article-container"> |
||||||
|
{{post.content}} |
||||||
</div> |
</div> |
||||||
|
<!-- Комментарии --> |
||||||
|
<section class="comment"> |
||||||
|
<div class="container"> |
||||||
|
<div class="comment-btn"> |
||||||
|
<button {% if function('is_user_liked_post', post.ID) %}class="active"{% endif %} data-post-id="{{ post.ID }}"> |
||||||
|
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||||
|
<path d="M17.7859 4.66406C14.7135 4.66406 13.3546 6.89752 13.0591 8.01424C12.8425 6.89752 11.5348 4.66406 8.03702 4.66406C3.66481 4.66406 1.71504 10.267 5.55549 15.0612C8.62786 18.8966 11.8381 20.3945 13.0591 20.6641C14.4181 20.4138 17.8686 18.8619 20.7991 14.6568C24.4623 9.40052 21.6263 4.66406 17.7859 4.66406Z" {% if function('is_user_liked_post', post.ID) %}fill="rgba(255, 0, 0, 0.7)" stroke="#ff0000"{% else %}fill="#121212"{% endif %}></path> |
||||||
|
</svg> |
||||||
|
Нравится |
||||||
|
</button> |
||||||
|
<span> |
||||||
|
{{ function('get_post_likes_count', post.ID) }} |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
<div class="comment-in"> |
||||||
|
<h3 class="comment-title"> |
||||||
|
{{ function('pll_e', 'КОММЕНТАРИИ') }} ({{ function('get_comments_number', post.ID) }}) |
||||||
|
</h3> |
||||||
|
{{ function('comments_template') }} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
<!-- Комментарии end --> |
||||||
</div> |
</div> |
||||||
</section> |
<!-- Article content end --> |
||||||
|
|
||||||
<!-- Article home end --> |
|
||||||
|
|
||||||
<!-- Article content --> |
<section class="home other-home"> |
||||||
<div class="article-content"> |
<div class="container"> |
||||||
<div class="article-container"> |
{% include '/blog/featured-slider.twig' %} |
||||||
{{post.content}} |
</div> |
||||||
</div> |
</section> |
||||||
</div> |
|
||||||
<!-- Article content end --> |
|
||||||
<section class="home other-home"> |
|
||||||
<div class="container"> |
|
||||||
{% include '/blog/featured-slider.twig' %} |
|
||||||
</div> |
|
||||||
</section> |
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %} |
{% endblock %} |
@ -1,30 +1,40 @@ |
|||||||
{% for post in posts %} |
{% set current_path = template_path ~ '/modules/blog/components/news-list' %} |
||||||
|
|
||||||
<li class="anons-best__card light"> |
|
||||||
<ul class="anons-best__card-alerts"> |
{% for post in posts %} |
||||||
{% for category in post.categories %} |
|
||||||
<li> |
<li class="anons-best__card light"> |
||||||
<a href="{{ category.link }}">{{ category.name }}</a> |
<ul class="anons-best__card-alerts"> |
||||||
</li> |
{% for category in post.categories %} |
||||||
{% endfor %} |
<li> |
||||||
</ul> |
<a href="{{ category.link }}">{{ category.name }}</a> |
||||||
<a href="{{post.link}}" class="main-img"> |
</li> |
||||||
<img src="{{post.thumbnail.src}}" alt="{{post.thumbnail.alt}}"> |
{% endfor %} |
||||||
</a> |
</ul> |
||||||
<div class="anons-best__card-body"> |
<a href="{{post.link}}" class="main-img"> |
||||||
<a href="{{post.link}}" class="anons-best__card-body__title">{{post.title}}</a> |
<img src="{{post.thumbnail.src}}" alt="{{post.thumbnail.alt}}"> |
||||||
<div class="anons-best__card-body__datas"> |
</a> |
||||||
<p>{{post.date}}</p> |
<div class="anons-best__card-body"> |
||||||
<p>{{ function('pll_e', 'время чтения') }}: {{post.reading_time}}</p> |
<a href="{{post.link}}" class="anons-best__card-body__title">{{post.title}}</a> |
||||||
<ul> |
<div class="anons-best__card-body__datas"> |
||||||
{% if post.get_author_name %} |
<p>{{post.date}}</p> |
||||||
<li class="logo"> |
<p>{{ function('pll_e', 'время чтения') }}: {{post.reading_time}}</p> |
||||||
<img src="{{post.get_author_img}}" alt=""> |
<ul> |
||||||
</li> |
<li> |
||||||
|
<img src="{{ current_path }}/assets/img/heart-grey.svg" alt=""> |
||||||
{% endif %} |
<span>{{ function('get_post_likes_count', post.ID) }}</span> |
||||||
</ul> |
</li> |
||||||
|
<li> |
||||||
|
<img src="{{ current_path }}/assets/img/msg-grey.svg" alt=""> |
||||||
|
<span>{{ post.comment_count }}</span> |
||||||
|
</li> |
||||||
|
{% if post.get_author_name %} |
||||||
|
<li class="logo"> |
||||||
|
<img src="{{post.get_author_img}}" alt=""> |
||||||
|
</li> |
||||||
|
{% endif %} |
||||||
|
</ul> |
||||||
|
</div> |
||||||
</div> |
</div> |
||||||
</div> |
</li> |
||||||
</li> |
{% endfor %} |
||||||
{% endfor %} |
|
@ -0,0 +1,60 @@ |
|||||||
|
{% extends 'layout.twig' %} |
||||||
|
|
||||||
|
|
||||||
|
{% block content %} |
||||||
|
|
||||||
|
{% set current_path = template_path ~ '/modules/author/' %} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Breadcrumb --> |
||||||
|
<section class="breadcrumb"> |
||||||
|
<div class="container"> |
||||||
|
<a href="/">{{ function('pll_e', 'Главная') }}</a> / |
||||||
|
<a href="/blog/">{{ function('pll_e', 'Блог') }}</a> / |
||||||
|
<a href="/blog_author/">{{ function('pll_e', 'Наши авторы') }}</a> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
<!-- Breadcrumb end --> |
||||||
|
|
||||||
|
<!-- Authors block --> |
||||||
|
<section class="authors"> |
||||||
|
<div class="container"> |
||||||
|
<h1>{{ function('pll_e', 'Все авторы') }}</h1> |
||||||
|
<ul> |
||||||
|
{% for author in authors %} |
||||||
|
<li> |
||||||
|
<a href="{{ author.link }}"> |
||||||
|
<div class="main-img"> |
||||||
|
<img src="{{ author.thumbnail.src|default(author.thumbnail|default('https://via.placeholder.com/150')) }}" alt="{{ author.title }}"> |
||||||
|
</div> |
||||||
|
<div class="authors-name">{{ author.title }}</div> |
||||||
|
<div class="authors-type">{{ author.position|default(author.meta('position')) }}</div> |
||||||
|
<p>{{ function('pll_e', 'статей:') }} {{ author.post_count|default(0) }}</p> |
||||||
|
</a> |
||||||
|
</li> |
||||||
|
{% else %} |
||||||
|
<li>{{ function('pll_e', 'Нет авторов для отображения.') }}</li> |
||||||
|
{% endfor %} |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
|
||||||
|
|
||||||
|
</section> |
||||||
|
|
||||||
|
{% include 'forms/discount.twig' %} |
||||||
|
<section class="blog-home other-home"> |
||||||
|
<div class="container"> |
||||||
|
<!-- Authors block end --> |
||||||
|
{% include '/blog/featured-slider.twig' %} |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{% endblock %} |
@ -0,0 +1,36 @@ |
|||||||
|
{% for post in posts %} |
||||||
|
<li class="anons-best__card light"> |
||||||
|
<ul class="anons-best__card-alerts"> |
||||||
|
{% for category in post.categories %} |
||||||
|
<li> |
||||||
|
<a href="{{ category.link }}">{{ category.name }}</a> |
||||||
|
</li> |
||||||
|
{% endfor %} |
||||||
|
</ul> |
||||||
|
<a href="{{ post.link }}" class="main-img"> |
||||||
|
<img src="{{ post.thumbnail.src|default('https://via.placeholder.com/150') }}" alt="{{ post.thumbnail.alt }}"> |
||||||
|
</a> |
||||||
|
<div class="anons-best__card-body"> |
||||||
|
<a href="{{ post.link }}" class="anons-best__card-body__title">{{ post.title }}</a> |
||||||
|
<div class="anons-best__card-body__datas"> |
||||||
|
<p>{{ post.date|date('d.m.Y') }}</p> |
||||||
|
<p>{{ function('pll_e', 'время чтения:') }} {{ post.reading_time|default(function('pll_e', '5 мин.')) }}</p> |
||||||
|
<ul> |
||||||
|
{% if post.get_author_img %} |
||||||
|
<li class="logo"> |
||||||
|
<img src="{{ post.get_author_img }}" alt="{{ post.get_author_name }}"> |
||||||
|
</li> |
||||||
|
{% endif %} |
||||||
|
<li> |
||||||
|
<img src="{{ current_path }}/assets/img/heart-grey.svg" alt=""> |
||||||
|
<span>{{ function('get_post_likes_count', post.ID) }}</span> |
||||||
|
</li> |
||||||
|
<li> |
||||||
|
<img src="{{ current_path }}/assets/img/msg-grey.svg" alt=""> |
||||||
|
<span>{{ post.comment_count }}</span> |
||||||
|
</li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</li> |
||||||
|
{% endfor %} |
@ -0,0 +1,92 @@ |
|||||||
|
{% set current_path = template_path ~ '/modules/blog/components/news-list' %} |
||||||
|
|
||||||
|
{% extends 'layout.twig' %} |
||||||
|
|
||||||
|
{% block content %} |
||||||
|
<main> |
||||||
|
<!-- Breadcrumb --> |
||||||
|
<section class="breadcrumb"> |
||||||
|
<div class="container"> |
||||||
|
<a href="/">{{ function('pll_e', 'Главная') }}</a> / |
||||||
|
<a href="/blog">{{ function('pll_e', 'Блог') }}</a> / |
||||||
|
<a href="#">{{ author.title }}</a> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
<!-- Breadcrumb end --> |
||||||
|
|
||||||
|
<!-- Authors block --> |
||||||
|
<section class="author-head"> |
||||||
|
<div class="container"> |
||||||
|
<div class="author-head-content"> |
||||||
|
<div class="main-img"> |
||||||
|
<img src="{{ author.thumbnail.src|default('https://via.placeholder.com/150') }}" alt="{{ author.title }}"> |
||||||
|
</div> |
||||||
|
<div> |
||||||
|
<div class="author-name">{{ author.title }}</div> |
||||||
|
<div class="author-type">{{ author.position }}</div> |
||||||
|
<div class="author-description">{{ author.content|striptags }}</div> |
||||||
|
<p>{{ function('pll_e', 'статей:') }} {{ author.post_count }}</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<h2>{{ author.meta('headline')|default(function('pll_e', 'Посты автора')) }}</h2> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
|
||||||
|
<section class="anons"> |
||||||
|
<div class="container"> |
||||||
|
<div class="anons-article"> |
||||||
|
<ul class="anons-article__card-wrap"> |
||||||
|
{% for post in author.posts %} |
||||||
|
<li class="anons-best__card light"> |
||||||
|
<ul class="anons-best__card-alerts"> |
||||||
|
{% for category in post.categories %} |
||||||
|
<li> |
||||||
|
<a href="{{ category.link }}">{{ category.name }}</a> |
||||||
|
</li> |
||||||
|
{% endfor %} |
||||||
|
</ul> |
||||||
|
<a href="{{ post.link }}" class="main-img"> |
||||||
|
<img src="{{ post.thumbnail.src|default('https://via.placeholder.com/150') }}" alt="{{ post.thumbnail.alt }}"> |
||||||
|
</a> |
||||||
|
<div class="anons-best__card-body"> |
||||||
|
<a href="{{ post.link }}" class="anons-best__card-body__title">{{ post.title }}</a> |
||||||
|
<div class="anons-best__card-body__datas"> |
||||||
|
<p>{{ post.date|date('d.m.Y') }}</p> |
||||||
|
<p>{{ function('pll_e', 'время чтения:') }} {{ post.reading_time|default(function('pll_e', '5 мин.')) }}</p> |
||||||
|
<ul> |
||||||
|
{% if post.get_author_img %} |
||||||
|
<li class="logo"> |
||||||
|
<img src="{{ post.get_author_img }}" alt="{{ post.get_author_name }}"> |
||||||
|
</li> |
||||||
|
{% endif %} |
||||||
|
<li> |
||||||
|
<img src="{{ current_path }}/assets/img/heart-grey.svg" alt=""> |
||||||
|
<span>{{ function('get_post_likes_count', post.ID) }}</span> |
||||||
|
</li> |
||||||
|
<li> |
||||||
|
<img src="{{ current_path }}/assets/img/msg-grey.svg" alt=""> |
||||||
|
<span>{{ post.comment_count }}</span> |
||||||
|
</li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</li> |
||||||
|
{% else %} |
||||||
|
<li>{{ function('pll_e', 'Нет постов') }}</li> |
||||||
|
{% endfor %} |
||||||
|
</ul> |
||||||
|
{% if total_pages > 1 %} |
||||||
|
<form id="ajax-load-author" data-total="{{ total_pages }}" data-author="{{ author.ID }}"> |
||||||
|
<input type="hidden" name="page_num" id="page_num" value="1"> |
||||||
|
<input type="hidden" name="action" value="get_author_posts"> |
||||||
|
<button class="anons-article__more-link"> |
||||||
|
{{ function('pll_e', 'ПОКАЗАТЬ ЕЩЁ') }} |
||||||
|
</button> |
||||||
|
</form> |
||||||
|
{% endif %} |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</section> |
||||||
|
<!-- Authors block end --> |
||||||
|
</main> |
||||||
|
{% endblock %} |
@ -0,0 +1,32 @@ |
|||||||
|
<div class="comment-block"> |
||||||
|
<div class="comment-user"> |
||||||
|
<img src="{{ comment.avatar ?? function('get_avatar_url', comment.author.id)|default('') }}" alt="{{ comment.author.name }}"> |
||||||
|
<div class="comment-user_text"> |
||||||
|
<h6> |
||||||
|
{{ comment.author.name }} |
||||||
|
</h6> |
||||||
|
<span> |
||||||
|
{{ comment.date }} |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<p> |
||||||
|
{{ comment.content }} |
||||||
|
</p> |
||||||
|
<div class="comment-btns"> |
||||||
|
<button class="reply-comment-btn" data-comment-id="{{ comment.ID }}"> |
||||||
|
<svg width="11" height="8" viewBox="0 0 11 8" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||||
|
<path d="M9.5 3H3.25C2.00736 3 1 4.00736 1 5.25V5.25C1 6.49264 2.00736 7.5 3.25 7.5H3.5" stroke="#666666"></path> |
||||||
|
<path d="M7 0.5L9.5 3L7 5.5" stroke="#666666"></path> |
||||||
|
</svg> |
||||||
|
{{ function('pll_e', 'Ответить') }} |
||||||
|
</button> |
||||||
|
<button class="like-comment-btn" data-comment-id="{{ comment.ID }}"> |
||||||
|
<svg width="15" height="13" viewBox="0 0 15 13" fill="none" xmlns="http://www.w3.org/2000/svg"> |
||||||
|
<path d="M10.7745 1C8.67239 1 7.7426 2.5355 7.54047 3.30325C7.39224 2.5355 6.49748 1 4.10427 1C1.11276 1 -0.221288 4.85199 2.40639 8.14801C4.50853 10.7848 6.705 11.8147 7.54047 12C8.47026 11.8279 10.8311 10.761 12.8363 7.87004C15.3427 4.25632 13.4022 1 10.7745 1Z" stroke="#666666"></path> |
||||||
|
</svg> |
||||||
|
{{ comment.like_count|default('0') }} |
||||||
|
</button> |
||||||
|
</div> |
||||||
|
<div class="reply-form-container" id="reply-form-{{ comment.ID }}" style="display: none;"></div> |
||||||
|
</div> |
@ -0,0 +1,36 @@ |
|||||||
|
<section class="discount__sale sec-bf"> |
||||||
|
<div class="container"> |
||||||
|
<div class="discount_top"> |
||||||
|
<h3 class="discount_title">{{sub_title}}</span> |
||||||
|
</h3> |
||||||
|
<div class="discount_top-imgs"> |
||||||
|
<img class="dicount_dog-img img--desktop" |
||||||
|
src="{{ theme.link }}/static/front-page/img/dicsount-sale.png" |
||||||
|
alt=""> |
||||||
|
<img class="dicount_dog-img img--mobile" |
||||||
|
src="{{ theme.link }}/static/front-page/img/dicsount-sale-mob.png" |
||||||
|
alt=""> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="dicsount__body"> |
||||||
|
|
||||||
|
<div class="" id="" lang="ru-RU" dir="ltr"> |
||||||
|
<div class="screen-reader-response"><p role="status" aria-live="polite" aria-atomic="true"></p> <ul></ul></div> |
||||||
|
<form class="form-process" action="subscribe_form" method="post" class="" aria-label="Контактная форма" novalidate="novalidate" data-status="init"> |
||||||
|
|
||||||
|
<div class="discount_form "> |
||||||
|
<span class="" data-name="subscriber"><input size="40" class="discount_form-inp" aria-required="true" aria-invalid="false" placeholder="{{ function('pll_e', 'Эл.почта') }}" value="" type="email" name="subscriber"></span> |
||||||
|
<img src="/wp-content/themes/cosmopet/static/front-page/img/discount-line-w.svg" data-src="https://cosmopet.shop/wp-content/themes/woodmart/images/svg/discount-line-w.svg" decoding="async" class=" lazyloaded"><noscript><img src="https://cosmopet.shop/wp-content/themes/woodmart/images/svg/discount-line-w.svg" data-eio="l"></noscript> |
||||||
|
|
||||||
|
<input type="hidden" name="from_url" value="{{ current_url }}"> |
||||||
|
<input type="hidden" name="form_name" value="Subscribtion form"> |
||||||
|
<button class="discount_form-btn main_link" type="submit">{{ function('pll_e', 'подписаться') }}</button> |
||||||
|
</div> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
<p class="discount_form-text"> |
||||||
|
{{ function('pll_e', 'Подписываясь на рассылку, я даю согласие на обработку персональных данных, на получение рекламных сообщений и новостей о товарах и услугах') }}</p> |
||||||
|
<p class="discount_text">{{sub_text}}</p> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</section> |