在我的作者。php页面,我想创建一个链接,将用户发送到该作者的所有帖子列表。我原以为这是WordPress的内置函数,但很难找到函数及其语法。
the_author_posts_link()
似乎只是链接回作者页面。
<div class="outerContainer longFormContainer">
<div class="contentContainerNarrow longFormContent">
<?php
$post_author_id = get_the_author_meta(\'ID\');
?>
<?php if( get_field(\'author_img\', \'user_\' . $post_author_id) ): ?>
<img class="alignleft" src="<?php the_field(\'author_img\', \'user_\' . $post_author_id); ?>" width="200" alt="<?php the_author(); ?>" />
<?php endif; ?>
<?php
if ( get_the_author_meta(\'description\') ) :
echo \'<p>\';
echo the_author_description();
echo \'</p>\';
endif;
?>
<p>View all posts by <?php the_author_posts_link(); ?></p>
</div>
</div>