WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Pagination with get_posts (4 posts)

  1. astromono
    Member
    Posted 3 years ago #

    Hi guys, I'm trying to set up a custom template that calls a loop with a specific category. I already have the loop itself working, but I can't seem to display the pagination as in the regular wordpress loop.

    Here is my code summed up. I can post the real (long) one if you wish:

    <div class="left">
    	<ul class="articles">
    		<?php if (have_posts()) : ?>
    
    		<?php $thePosts = get_posts('category=13510');
    foreach($thePosts as $post) : setup_postdata($post);
    ?>
    
    LOOP INFO HERE
    
    <?php endforeach; ?>

    Help?

  2. vtxyzzy
    Member
    Posted 3 years ago #

    This pastebin article shows one way to paginate an array from a custom query.

  3. astromono
    Member
    Posted 3 years ago #

    thanks! In the end I decided to stop being stubborn and just used get_query with an array. Thanks!

  4. vtxyzzy
    Member
    Posted 3 years ago #

    You are welcome!

Topic Closed

This topic has been closed to new replies.

About this Topic