• I have a question regarding WordPress Search Results:
    I try to “Number each result” in my search page, with some help of “nublooo” i’v do that code who let me to number each result and it work perfectly.
    But while i click for next result, the number count to new number again:
    page 01 : 1 – 2 – 3 – 4 – 5
    page 02 : 1 – 2 – 3 – 4 – 5
    … and other page results

    her the code i use:

    <?php get_header($postnum = 1); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    
            <div class="count">
    <?php echo $postnum; ?>
    	</div>
    
    	<p>lorem ipsum dolar set</p>
    
    <?php $postnum++; ?>
    <?php endwhile; ?>
    
    	<div class="page-nav">
    		<span class="previous-entries"><?php next_posts_link('Next') ?></span>
    		<span class="next-entries"><?php previous_posts_link('Previous') ?></span>
    	</div>
    
    <?php else : ?>
    <?php endif; ?>
    <?php get_footer(); ?>

    Thanks!
    Cheers,

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Number each result’ is closed to new replies.