WordPress.org

Forums

Listing both blog entries and pages in author template (3 posts)

  1. spiff06
    Member
    Posted 8 years ago #

    I may be overlooking something really obvious, but here's my issue: when I use the sample author.php template, has_posts() returns only the blog entries for the specified author, not the pages.

    Is there an equivalent to has_posts() for pages (called has_pages(), or something similar)? If not, how would I go about circumventing the problem and list pages for a specific author?

    Thanks!

  2. moshu
    Member
    Posted 8 years ago #

    There is no "has_post" - there is "have_post", although that does NOT refer to the author > it is part of The_Loop.

    I don't know of any query that would retrieve the Pages since they are not part of the chronological stream of the post type entries, so the regular WP queries don't show them.

  3. spiff06
    Member
    Posted 8 years ago #

    Well, what makes little sense is that, when I show the number of "posts" made by a particular author on the sidebar with wp_list_authors(), the number corresponds to the sum total of both number of posts and number of pages.

    When I click on the author to view his/her profile page, only the posts are listed, so it looks as though there's information missing.

    And I really don't see why pages shouldn't be listed. It would be appropriate to see that information as well when viewing an author profile.

    I'll try and find a workaround.

Topic Closed

This topic has been closed to new replies.

About this Topic