If you have blog with more than one author, is a lot of situations, when you have two or more writers in one post. That is normal for big blog. Managing with multi-author blog does not have to be hard. WordPress default is not supporting multiple authors for single post.
In this short tutorial I will show you, how to credit and display multiple authors for single post in WordPress with plugin.
First, you need to download and install new plugin called Co-Authors Plus. This free WordPress plugin allows you to assign multiple authors for posts, custom post types and pages. How to use it?
After enable plugin, go to Users > Guests Authors
To add new Guest Author, click to Add New and fill fields and save it by clicking blue button “Add New Guest Author”.
How to Assing Guest Author to WordPress Post?
That is also simple to do. Go to post edit screen and below content you will see metabox “Authors”. In field enter co-author name and with drag&drop method set, which author will be displayed as first author of post.
Now is the hardest part of your work. Default, WordPress themes use the_author() tag to display author on post. If you want to use Co-Author Plus plugin and connect it with your WordPress theme, you have to edit template file. For single posts, for 99% you have to edit file single.php. You find this file on your Theme folder (/wp-content/themes/ThemeName/single.php).
Find code like the_author(); and edit it to tags, you can read below:
- coauthors() — Display first and last name of each author
- coauthors_posts_links() — Display first and last name of each author with links to profile pages
- coauthors_firstnames() — Display first name of authors
- coauthors_lastnames() — Display last name of authors
After small modification of your wordpress single.php file, new code may look like this:
1 2 3 4
if(function_exists('coauthors')) coauthors(); else the_author_posts_link();
How this code works? First checks if function coauthors exist – Co-Authors Plugin is enabled. If is enabled, shows author names without links. If not, uses default WordPress function to display author.