How to get authors details in feature posts?

Hello, I am trying to get author details in my theme for the feature post.

index.hbs
{{#get "posts" filter="featured:true" limit="3" as | posts|}}
  {{#foreach posts}}
    {{> post-card}}
  {{/foreach}}    
{{/get}}
post-card.hbs
            <!-- Footer -->
            <footer class="d-flex align-items-center mt-auto">
                <!-- Avatar-->
                {{#foreach authors}}
                    {{#if profile_image}}
                        <div class="avatar avatar-sm"><img class="avatar-img rounded-circle" src="{{img_url profile_image}}" alt="{{name}}" /></div>
                    {{else}}
                        <div class="avatar avatar-sm"><img class="avatar-img rounded-circle" src="https://goodkit.goodthemes.co/assets/img/avatars/avatar-1.jpg" alt="..." /></div>
                    {{/if}}
                {{/foreach}}
                <!-- Body-->
                <div class="ms-4">
                    <!-- Title-->
                    <h6 class="font-sans-serif mb-0 text-black">{{#foreach authors}}{{name}}{{/foreach}}</h6>
                    <!-- Position-->
                    <p class="small text-muted mt-n1 mb-0">{{date format="D MMM YYYY"}} - <span class="text-muted">{{reading_time}}</span></p>
                </div>
            </footer>

I am unable to fetch the author’s details. Is there something that i am missing ?

You need to add include="authors" in your {{#get}} helper call :slight_smile: Ghost Handlebars Theme Helpers: get

1 Like