miralize
Member
Posted 1 year ago #
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.
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);
?>
miralize
Member
Posted 1 year ago #
Aghh thanks. Yep it is, I'm pulling in blog posts and thumbnails. Cheers for that :)
miralize
Member
Posted 1 year ago #
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.
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.
miralize
Member
Posted 1 year ago #
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.
louissoriano
Member
Posted 1 year ago #
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 »') ?></p></div>
<div class="float-right"><p><?php previous_posts_link('« Previous') ?></p></div>
<?php endwhile;?>