(Solved) How to show post author?

Greetings everyone!

I am assisting in the (re)creation of a site. The plan is to have about five different authors, so I was wondering how to show the author’s name on a post.

I have read all the similar topics here but I can’t seem to make it work. I have managed to get it to show the “default” site author on every post but I don’t understand what is needed so the author’s name would be of the person writing a post and not the default one.

Could someone please provide me with instructions? Since everything about Grav is pretty much new to me, every little detail would be greatly appreciated.

Hi, it should be something like that

{# POST WRITTEN BY MULTIPLE AUTHORS #}
    {% if page.taxonomy.author|length > 1 %}
        {% for author in page.taxonomy.author %}
            <a href="{{base_url}}/author:{{author}}"><span>{{ author }}</span></a>
        {% endfor %}

    {# POST WRITTEN BY A SINGLE AUTHOR #}
    {% else %}
        {% for author in page.taxonomy.author %}
            <a href="{{base_url}}/author:{{author}}"><span>{{ author }}</span></a>
        {% endfor %}
    {% endif %}
4 Likes

Thank you! It works exactly as expected.
I have many more questions but I will be kind enough not to bother anyone for now.
Thank you again iusvar.

I am happy for you.
Grav encourages you to learn by yourself, when you can not succeed there is a very helpful community.
Good luck!

I have no real technical skills. The site I’m helping with was previously on Drupal and made by other guys. But since everything is on voluntary basis and life happens, we found ourselves in need of something more manageable by “ņon-tech” people.

So we discovered Grav and it pretty much fills all our needs. Eventhough our new site is only a couple of days in the works, it’s coming along nicely. The only showstoppers are the registration/login system and the comments section, for which I’m planning on using the Discourse integration plugin (unless there is another suggestion).

I’ll dive into the excellent documentation and probably come back with more questions but so far I like what I’m seeing and the possibilities it provides.