WordPress.org

Ready to get started?Download WordPress

Forums

Paginate archive list (4 posts)

  1. gulliver
    Member
    Posted 1 year ago #

    I'm showing a list of post titles, arranged a-z, using this code:

    <ul>
    <?php wp_get_archives('type=alpha'); ?>
    </ul>

    How do I paginate it?

  2. vtxyzzy
    Member
    Posted 1 year ago #

    Here is an article that shows how to paginate an array using the WP function paginate_links():

    http://wordpress.mcdspot.com/2010/11/25/pagination-using-paginate_links/

  3. gulliver
    Member
    Posted 1 year ago #

    Thanks.

    However, unfortunately that's too complex for me to understand.

    But, having studied things more, I've since found a way which works and I understand.

    In case it might help someone...

    Instead of type+alpha, I used:

    <?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("orderby=title&order=asc&showposts=10&paged=$page"); ?>
    
    <?php while ( have_posts() ) : the_post() ?>
    
    <p><a href="<?php the_permalink(); ?>" title="read this entry"><?php the_title(); ?></a></p>
    
    <?php endwhile ?>
  4. vtxyzzy
    Member
    Posted 1 year ago #

    Glad you found a solution! Please use the dropdown on the right to mark this topic 'Resolved' so that anyone else with this question can see that there is a solution.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.