• I am using a navigation to go from post to post:

    <?php next_post('%', '<img src="http://www..." alt="previous"> ', 'no'); ?>
    <?php previous_post('%', '<img src="http://www...." alt="next"> ', 'no'); ?>

    and I want to have a “random post button”:

    <?php $posts = get_posts('orderby=rand&numberposts=1');
    foreach($posts as $post) { ?>
    <a href="<?php the_permalink(); ?>" >RANDOM</a>
    <?php } ?>

    This works fine – but when I place the random button between the previous and the next button, then it messes up the next button (which becomes random too).

    Any ideas how I could fix that?

The topic ‘Link to random post messes up navigation’ is closed to new replies.