Multiple authors in one byline

We’re using the Journal theme for a small blog with multiple contributors. Currently, if an article is written by more than one author, only the first author gets credited in the byline at the top of the post.

This post, for instance, has three authors in the sidebar but only the first appears at the top of the page. The screenshot below shows the situation as well:

I’m hoping to modify the theme or toggle a setting somewhere that allows a list of authors to appear where it currently says “By Dynamic Zero Editing Board” on the left side of the screenshot.

1 Like

This is theme-specific, but shouldn’t be hard to change if you’re able to edit the theme.

2 Likes

Thanks! Yes i see the author context in the Journal theme post.hbs, which contains the following relevant section:

<span class="gh-article-meta">
                {{#primary_author}}By <a href="{{url}}">{{name}}</a>{{/primary_author}}
                {{#if primary_tag}}
                    in
                    <a class="gh-article-tag" href="{{primary_tag.url}}">{{primary_tag.name}}</a>
                {{/if}}
                —
                <time datetime="{{date format="YYYY-MM-DD"}}">{{date}}</time>
            </span> 

However, I don’t understand the Primary tag. It’s not mentioned in the Author page in the docs. I also don’t know how to iterate in the author list to produce the string, “By author_1, author_2, and author_3” or “By author_1 and author_2”. Does anyone know where I can find information on that? Does another theme have a code block like that I can reference?

1 Like

The primary_tag part is what’s displaying the name of the tag. It’s not relevant for authors.

Take a look at how Casper does it - starting around line 35.

You’ll need different HTML, but that shows you how to loop through the authors with foreach and write out some content for each.

3 Likes