add author
This commit is contained in:
25
author.php
Normal file
25
author.php
Normal 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(); ?>
|
||||||
@@ -31,7 +31,8 @@
|
|||||||
<?php if ( $author AND $author->display_name !== 'agroexpert.press' AND $author->display_name !== 'Анна Купровская') : ?>
|
<?php if ( $author AND $author->display_name !== 'agroexpert.press' AND $author->display_name !== 'Анна Купровская') : ?>
|
||||||
<div class="article-author">
|
<div class="article-author">
|
||||||
<div class="article-author__name">
|
<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 !== '' ):?>
|
<? if ( $author->description !== '' ):?>
|
||||||
<?=$author->description?>
|
<?=$author->description?>
|
||||||
<?endif?>
|
<?endif?>
|
||||||
|
|||||||
Reference in New Issue
Block a user