בסיעתא דשמיא

Writing

  • Poetry

Tweets


Hacking the Atahualpa Theme for Showing Multiple Author Bylines and Bios with the Co-Authors Plus Plug-In in WordPress

For posts with multiple contributors in WordPress, showing multiple names in the byline requires some hacking. One must install the Co-Authors Plus plug-in and then edit the code for their particular WordPress theme. Documentation written by Daniel Bachhuber, the author of the Co-Authors Plus plugin is located here. For those using the Atahualpa theme in WordPress, documentation is uneven, incomplete, and hard to come by. Hopefully, this post will provide more comprehensive guidance and save someone the time I spent I trying to figure this out. You can see an example of my solution in effect at the Open Siddur Project — check out the byline and multiple-author bios in this post. (Please share with me any improvements you might have to what I’ve written below.)

First Step

To add multiple contributors to the byline, I installed the Co-Authors Plus plug-in, and then following Juggledad’s advice replaced a few lines of code in bfa_postinfo.php, a file in the “functions” directory of the Atahualpa theme folder. Juggledad says, “in Atahuapa there are 17 places you will have to change AND you will have to make this change each time you upgrade the theme,” but I found that I got the desired effect only making this change in three places, replacing “the_author();“, “the_author_url();“, “the_author_link();” with the code, “coauthors_posts_links();", as seen in the following example.

// Author public name
if ( strpos($postinfo_string,'%author%') !== FALSE ) {

ob_start();
the_author();
$author = ob_get_contents();
ob_end_clean();
$postinfo = str_replace("%author%", $author, $postinfo);

}

with

if ( strpos($postinfo_string,'%author%') !== FALSE ) {

ob_start();
coauthors_posts_links();
$author = ob_get_contents();
ob_end_clean();
$postinfo = str_replace("%author%", $author, $postinfo);

}

Here’s my entire modified bfa_postinfo.php file (from Atahualpa version 3.7.22) for comparison.

Second Step

In the Atahualpa directory, I added the following code to the index.php file inside “the loop” between bfa_post_bodycopy and bfa_post_pagination:

This is a slightly adapted implementation of a code snippet shared by Daniel Bachhuber here. (User “Rob_st” presents an alternative solution, however, I couldn’t figure out how to properly integrate his code snippet without breaking WordPress. Bill Erickson also provides yet another solution but from what I could tell it is really only relevant for those using the Genesis theme in WordPress.)

Final Step

Make sure to make backups of the files you edit in case you misplace a semi-colon and need to backtrack. Save your changes too since you’ll need to modify these files whenever you update your Atahualpa theme.

About Aharon N. Varady


Aharon's Omphalos is the hobbit hole of Aharon Varady, founding director of the Open Siddur Project. He is a community planner and environmental educator working to improve stewardship of the Public Domain, be it the physical and natural commons of urban park systems or the creative and cultural commons of libraries and museums. His advocacy for open-source strategies in the Jewish community has been written about in the Atlantic Magazine, Tablet, and Haaretz. He is particularly interested in pedagogies for advancing ecological wisdom, developing creative and emotional intelligence, and realizing effective theurgical praxes . He welcomes your comments, personal messages, and kind words.

Leave a Reply

בסיעתא דארעא