WordPress.org

Support

Support » Themes and Templates » [Resolved] Page 2,3 etc.. in blog redirecting to homepage

[Resolved] Page 2,3 etc.. in blog redirecting to homepage

  • Hey guys, I’m running the RC3 of WordPress and I dunno when it started but whenever I go to http://miralize.com/blog/page/2/ it goes to the homepage instead of the second page of blog posts.

    I have home as my static page and a blog page for my blog posts. Any help would be greatly appreciated.

Viewing 6 replies - 1 through 6 (of 6 total)
  • esmi

    @esmi

    Forum Moderator

    Does your index.php file use a custom query? If so, you need to modify it to include the paged variable – eg:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'category_name' => 'News',
    	'paged' => $paged
    );
    query_posts($args);
    ?>

    Aghh thanks. Yep it is, I’m pulling in blog posts and thumbnails. Cheers for that 🙂

    Sorry it isnt. It only has the regular

    <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
    
    <?php endwhile; else :  endif; ?>

    i thought you were talking about my homepage.php page.

    esmi

    @esmi

    Forum Moderator

    Your blog page should be using the theme’s index.php template file. I’ve just checked your Blog page and the page 2, 3 etc seem to be working.

    Yeah I fixed it. It was a problem with a function. I was excluding a portfolio category , but now that wp3 is out I moved to custom post types and I removed the function to exclude the category.

    Thanks anyway.

    I actually have the same problem. The next page (next_post_link) is redirecting me to index.php template. Can you explain further in specific how u are able to solve the problem? Sorry I’m new to wordpress and can’t quite understand your solution to the problem. Below is the code I use

    <?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 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Page 2,3 etc.. in blog redirecting to homepage’ is closed to new replies.