Forum

Thread tagged as: Question, Problem, Blog

Blog archive of authors only listing one

When using the drop down for meta authors, all is well, the post page links to their other posts properly, but in my archive div when using the authors listing function, only one author shows up in the list (he has a higher role perm level than the others, if that helps).

Kevin Wolff

Kevin Wolff 0 points

  • 3 years ago

Can you post the relevant code that isn't working in the way that you expect?

Clive Walker said:

Can you post the relevant code that isn't working in the way that you expect?

Sure thing. Here's the PHP and related template:

<?php 
                perch_blog_categories();
                perch_blog_authors(['template' => 'author_link.html',]);
                perch_blog_date_archive_months(); 
            ?>

Template:

<perch:before>
<h3>Authors</h3>
<ul>
</perch:before>
    <li>
        <a href="/blog/archive?author=<perch:blog id="authorSlug" type="text" />">
            <perch:blog id="authorGivenName" type="text" label="First Name" /> <perch:blog id="authorFamilyName" type="text" label="Last Name" /> (<perch:blog id="authorPostCount" />)
        </a>
    </li>
<perch:after>
</ul>
</perch:after>

That looks OK to me.

I would double check posts and author profiles in Perch admin. I would also create new author on local development site and check/test the permissions thing there.

I would also turn on Perch Debug https://docs.grabaperch.com/perch/configuration/debug/ and post the results for the problem page.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Do all the authors have posts?

Yes, there are four authors in the blog and there are live blog posts showing two of them at the moment. There were three yesterday, and all the links to the author pages from the posts work, but that function only seems to show the first author to use the blog. It's at https://www.interfitphoto.com/blog

Drew McLellan

Drew McLellan 2638 points
Perch Support

Did you try turning on debug? What does it output?

Drew McLellan said:

Did you try turning on debug? What does it output?

Using template: /templates/blog/category_link.html
Caching: perch_blog_categories589c7a634eb12f2ec225cfedc7dc78ae
Fetching from cache: perch_blog_authors316a3840d14009386ffedea6e52e5865
[1] SELECT tbl.* FROM ( SELECT idx.itemID, main.*, idx2.indexValue as sortval FROM perch3_blog_index idx JOIN perch3_blog_authors main ON idx.itemID=main.authorID AND idx.itemKey='authorID' JOIN perch3_blog_index idx2 ON idx.itemID=idx2.itemID AND idx.itemKey='authorID' AND idx2.indexKey='_id' WHERE 1=1 AND idx.itemID=idx2.itemID AND idx.itemKey=idx2.itemKey GROUP BY idx.itemID, idx2.indexValue, authorID ) as tbl WHERE (authorPostCount>0) GROUP BY itemID, sortval ORDER BY sortval ASC
[1] Using template: /templates/blog/author_link.html
Caching: perch_blog_authors316a3840d14009386ffedea6e52e5865
Fetching from cache: perch_blog_date_archive_monthsf2e7d49784704a5b24102a78c349d57c
[3] SELECT year(postDateTime) as year, COUNT(*) AS year_qty FROM perch3_blog_posts WHERE postStatus='Published' AND postDateTime<='2018-06-29 10:51:00' GROUP BY year ORDER BY year DESC
Drew McLellan

Drew McLellan 2638 points
Perch Support

That looks fine - I'm not sure where the problem lies in this case.