add author

This commit is contained in:
argoexpert press
2025-02-26 20:30:02 +03:00
parent ec987eb1be
commit c972398238
2 changed files with 27 additions and 1 deletions

25
author.php Normal file
View File

@@ -0,0 +1,25 @@
<?php get_header(); ?>
<div class="content-middle articles-wrapper">
<?php get_template_part('partials/rubrics-mobile'); ?>
<div class="section-title desktop">
<h1 class="section-title__title"><?= get_the_author(); ?></h1>
</div>
<div class="articles-preview">
<?php
$paged = (get_query_var('paged')) ? absint(get_query_var('paged')) : 1;
$args = array(
'post_type' => 'post',
'posts_per_page' => 11,
'paged' => $paged,
'author' => get_queried_object_id()
);
$query = new WP_Query($args);
?>
<?php get_template_part('partials/post-list', null, ['query' => $query]); ?>
</div>
<?php custom_pagination(); ?>
</div>
<?php get_footer(); ?>

View File

@@ -31,7 +31,8 @@
<?php if ( $author AND $author->display_name !== 'agroexpert.press' AND $author->display_name !== 'Анна Купровская') : ?>
<div class="article-author">
<div class="article-author__name">
<?= $author->display_name; ?><br>
<a href="<?= get_author_posts_url($author->ID); ?>">
<?= $author->display_name; ?></a><br>
<? if ( $author->description !== '' ):?>
<?=$author->description?>
<?endif?>