I have searched through this site and online foran answer to my problem and tried lots of different suggestions offered and nothing works - please help!
I'm using the WP-PageNavi plugin. With the code on my index-work.php page:
<?php query_posts('post_type=work'); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post">
<div class="boxgrid captionfull">
<?php the_post_thumbnail('work-thumb'); ?>
<div class="cover boxcaption backopacity">
<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<?php the_excerpt(''); ?>
</div>
</div>
</div>
<?php endwhile ?>
<div class="clearleft"></div>
<div class="post-nav">
<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
</div>
<?php else : ?>
<h2>Not Found</h2>
<p>Sorry, but you are looking for something that isn't here.</p>
<?php endif; ?>
If I have more than 4 pieces of work and I click on the pagination link to go to the next page I get a 404 error. The URL appears as:
http://www.mbsgraphicdesign.com/work/page/2/
Any ideas on how to fix this?
The pagination does not work on my index-work.php page and I get the 404 error as above but if I click on one of the taxonomies in the sidebar, like Artists and go to:
http://www.mbsgraphicdesign.com/workcategories/artists/
The pagination works fine using the exact same code and I get taken to:
http://www.mbsgraphicdesign.com/workcategories/artists/page/2/
with no 404 error. Why does it work here but not on the index page and how do I solve this issue?
----------EDIT-------------
In case this is important I have my permalinks structure set as follows:
/%category%/%postname%/
If i change this to be:
/blog/%category%/%postname%/
all the pagination works fine through the work section but the URLS are all wrong - they look fine within the blog, but within my work pages I now get:
http://www.mbsgraphicdesign.com/blog/work/british-american-project/
I don't want the /blog bit to be there!
This is SO frustrating - can anyone help me with this?????