Problem with get_posts() (2 posts)

  1. fatihturan
    Posted 5 years ago #

    I'm using get_posts() function for display my most like this code snippet:

    <ul id="archive_posts">
    <?php $i = 0; ?>
    <?php $myposts = get_posts('numberposts=-1&cat=-5');
    foreach($myposts as $post) : ?>
    <?php $i++; ?>
    <li><a href="<?php the_permalink(); ?>" <?php if($i&1) { echo 'class="odd"';} else {echo 'class="even"';} ?>><?php the_title(); ?><span><?php the_time('d F Y H:i') ?></span></a></li>
    <?php endforeach; ?>

    And i want to use next/previous links. But WordPress doesn't allow to display prev/next links without loop.

    However i want to use next/prev links with above codes.

    Can anybody help me?

  2. stvwlf
    Posted 5 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic