1

I created a "co_writer" custom taxonomy with author names as terms. I only use this taxonomy to output their names as co-authors on multi-author posts. As such, posts in which an author's name appears as a co-author (the custom taxonomy term) don't get displayed on that author's actual archive page.

I want the author's page to display not only posts an author alone has written but also posts that bear their namesake "co_writer" custom taxonomy term.

This is the present code in author.php:

    <?php
                if (have_posts()) : ?>
    
                    <header class="header-title-wrapper">
    xxx
                    <?php
                    /* Start the Loop */
                    while (have_posts()) : the_post();

get_template_part('template-parts/content', get_post_format());

                endwhile; ?>

Thanks to anyone who may be able to help.

2
  • You're probably looking for this action hook: pre_get_posts.
    – Pat J
    Jan 30 at 19:17
  • Hi @PatJ, thanks for your reply. I've got the linked code but it still just retrieves posts written by the current author and not includes posts which that current author's name is tagged as a "co_writer" term: wordpress.stackexchange.com/a/422269/206902
    – Sum
    Feb 5 at 9:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.