WordPress.org

Ready to get started?Download WordPress

Forums

Display Posts by Author (5 posts)

  1. convan23
    Member
    Posted 7 years ago #

    Okay I was wondering If I could display all the posts that the person logged in has written?

    So like if I had a page title 'My Page' that once a user has logged in they click on it and it displays all the titles to all the posts they have written and links to them.

  2. Samuel B
    moderator
    Posted 7 years ago #

  3. Ryan Fitzer
    Member
    Posted 7 years ago #

  4. convan23
    Member
    Posted 7 years ago #

    Dang i didnt even think to look at the codex. Thanks.

    Oh and btw the code on the links you gave me were more complicated then they needed to be in my opinion. So I decided to try something out to see if it worked and it did - I just changed the loop to look like this:

    code
    <?php query_posts( 'posts_per_page=1' . '&author_name=' . $user_identity ); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div class="about">
    <h1><?php the_title(); ?></h1>
    <?php the_excerpt() ?>
    <h5>» " title="Permanent Link to <?php the_title(); ?>">Read More</h5>
    </div>
    <?php endwhile; ?>
    <?php else : ?>
    <?php endif; ?>
    /code
    And it works. But thanks anyway it got me thinking

  5. Ryan Fitzer
    Member
    Posted 7 years ago #

    Great. Now mark this puppy resolved.

Topic Closed

This topic has been closed to new replies.

About this Topic