Categories
Troubleshooter Web editing

Customize WordPress posts written by particular authors

Sometimes you may need to display custom information or in any way change a post, if it is written by a particular author. WordPress reference pages are not that helpful here, rather confusing, yet there is a simple way to do it. Just open the conditional

<?php if($post->post_author == '2'): ?>

Continue with whatever author-specific content you’d like, such as displaying a link to this author’s archives

More by <?php the_author_posts_link(); ?>

And finally close the conditional

<?php endif; ?>

Don’t forget to replace number ‘2’ above with the ID of your author.

Exit mobile version