Support » Fixing WordPress » wp query pagination always redirecting to index.php

  • Hi, I am new to this forum and hoping if you guys can help me. I have a category page, and inserted a wp_query loop which calls for the specific category and inserted the next_post_link to show page 2 of the category post. I have searched a lot of forums and tested a lot of codes but it keeps redirecting me to index.php. Do I need to create a function.php or modify htaccess? Sorry I’m really new to wordpress as I think this is working before I upgraded to version 3 of wordpress. Below is my code

    <?php
    
    							$wp_query = new WP_Query();
    
    							$wp_query->query('category_name=nail-salon&showposts=1&order=ASC'.'&paged='.$paged);
    						?>
    
                            <?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
    
                            <?php the_content(); ?>
    
                           		<div style="clear:right;"></div>
    
                            	<br /><br />
    
      							<div class="float-right" style="margin-left:10px;"><p><?php next_posts_link('More &raquo;') ?></p></div>
                                <div class="float-right"><p><?php previous_posts_link('&laquo; Previous') ?></p></div>
    
                            <?php endwhile;?>
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘wp query pagination always redirecting to index.php’ is closed to new replies.