WordPress.org

Ready to get started?Download WordPress

Forums

author.php: list all PAGES? (3 posts)

  1. somnambulant
    Member
    Posted 4 years ago #

    I know how to display all the author's posts via The Loop in author.php, but I'm wondering if there's a way to display all of the pages that they have authored as well. Basically the site I'm trying to set up will have multiple authors writing serialized content (blog posts), but they will also be responsible for writing some more static 'help/resources' pages on various topics. I thought it would be easiest to just generate this via The Loop, but I can't seem to find a way to do it.

    Any tips?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 4 years ago #

    What about using get_pages('sort_column=post_author')?

    http://codex.wordpress.org/Function_Reference/get_pages

  3. shoy111
    Member
    Posted 3 years ago #

    Somnambulant,

    New-ish to word press. How do I display all the author's posts via The Loop in author.php. Here is what my author.php looks like. What and where do I have to change?

    <?php get_header(); ?>

    <div id="content" class="narrowcolumn">

    <!-- This sets the $curauth variable -->

    <?php

    if(isset($_GET['author_name'])) :

    $curauth = get_userdatabylogin($author_name);

    else :

    $curauth = get_userdata(intval($author));

    endif;

    ?>

    <h2>Posts by <?php echo $curauth->nickname; ?>:</h2>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic