I have tried using a few guides for pagination but i can't get any of them to even display the page numbers which i just don't understand... So i have resorted to trying out a plug in, which atleast shows the page numbers, but when you click on page 2 it does nothing. Can anyone either help me get pagination working without this plug in or get this plug in to actually work?
doesn't wordpress have it's own pagination? Have you tried the template tags? if the plugin you are using doesn't work, try a different one. There are lots of them. I don't know how to help you without you giving access to your site. unless you post code
<div class="blog-readmore"><a href="<?php the_permalink(); ?>">Read more »</a></div>
</div> </div>
<?php endwhile; else : ?>
<h2>Woops...</h2>
<p>Sorry, no posts were found.</p>
<?php wp_link_pages(); ?> <?php endif; ?>
<?php wp_pagenavi(); ?> </div> </div>
<?php get_footer(); ?>
Thats the code for the blog page, been trying to find answers for pagination since i started learning wordpress and haven't found anything that works, or explains it in detail.
tried moving that as well as <?php wp_pagenavi(); ?> to different places, and still not working, if i put it before the endwhile; else then the page numbers show after every post and still doesnt work.
<!-- Start the Loop. --> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- The following tests if the current post is in category 3. --> <!-- If it is, the div box is given the CSS class "post-cat-three". --> <!-- Otherwise, the div box will be given the CSS class "post". --> <?php if ( in_category('5') ) { ?> <div class="post-cat-three"> <?php } else { ?> <div class="post"> <?php } ?>
<!-- Display the Title as a link to the Post's permalink. --> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. --> <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>
<!-- Display the Post's Content in a div box. --> <div class="entry"> <?php the_content(); ?> </div>
<!-- Display a comma separated list of the Post's Categories. --> <p class="postmetadata">Posted in <?php the_category(', '); ?></p> </div> <!-- closes the first div box -->
<!-- Stop The Loop (but note the "else:" - see next line). --> <?php endwhile; else: ?>
<!-- The very first "if" tested to see if there were any Posts to --> <!-- display. This "else" part tells what do if there weren't any. --> <p>Sorry, no posts matched your criteria.</p>
<!-- REALLY stop The Loop. --> <?php endif; ?>
try that loop above. You can see the if(in_category(5)) part of the loop. Try it and see if it works. If it does, you can modify it to show the amount of posts that you want
your problem is in here <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'paged' => $paged, 'posts_per_page' => 5, 'caller_get_posts' => 0,
if you check the url after clicking on the two, you can see the address is wrong. I don't know how to fix it for you. Sorry
It really is way more complicated than it should be. But WordPress is still growing into a functioning CMS, I'm sure things like this will get taken care of eventually.
http://www.lsw-design.com/tf/Gridded/?page_id=8
<?php get_header(); ?>
<div id="pagename">
<div id="pagename-inside">
<h1>Blog</h1>
</div>
</div>
<div id="blog-inside">
<?php get_sidebar(); ?>
<div id="content-blog">
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'paged' => $paged,
'posts_per_page' => 5,
'caller_get_posts' => 0,
);
query_posts('cat=-5');
if (have_posts()) :
while (have_posts()) :
the_post(); ?>
<div class="post">
<div class="home-thumb"
<a class="post-thumb-a" href="<?php the_permalink(); ?>"><?php echo getImage(302,302,"2");?></a>
<a class="post-thumb-b" href="<?php the_permalink(); ?>"><?php echo getImage(302,302,"");?></a>
</div>
<div id="entry">
<div id="post-date"><span class="post-date"><?php the_time('F j, Y'); ?></span><span class="post-author"> By <?php the_author_meta('nickname'); ?></span><span class="post-comments"><?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span></div>
<h2 id="post-title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
<div class="blog-readmore"><a href="<?php the_permalink(); ?>">Read more »</a></div>
</div>
</div>
<?php endwhile; else : ?>
<h2>Woops...</h2>
<p>Sorry, no posts were found.</p>
<?php wp_link_pages(); ?>
<?php endif; ?>
<?php wp_pagenavi(); ?>
</div>
</div>
<?php get_footer(); ?>
Thats the code for the blog page, been trying to find answers for pagination since i started learning wordpress and haven't found anything that works, or explains it in detail.
I think it should be query_posts('cat=5');
http://codex.wordpress.org/Function_Reference/query_posts
try moving your
<?php wp_link_pages(); ?>
up before the
<?php endwhile; else : ?>
wp_link_pages must be inside the loop. maybe it's not executing where you have it?
<!-- Start the Loop. -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- The following tests if the current post is in category 3. -->
<!-- If it is, the div box is given the CSS class "post-cat-three". -->
<!-- Otherwise, the div box will be given the CSS class "post". -->
<?php if ( in_category('5') ) { ?>
<div class="post-cat-three">
<?php } else { ?>
<div class="post">
<?php } ?>
<!-- Display the Title as a link to the Post's permalink. -->
<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
<!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
<small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>
<!-- Display the Post's Content in a div box. -->
<div class="entry">
<?php the_content(); ?>
</div>
<!-- Display a comma separated list of the Post's Categories. -->
<p class="postmetadata">Posted in <?php the_category(', '); ?></p>
</div> <!-- closes the first div box -->
<!-- Stop The Loop (but note the "else:" - see next line). -->
<?php endwhile; else: ?>
<!-- The very first "if" tested to see if there were any Posts to -->
<!-- display. This "else" part tells what do if there weren't any. -->
<p>Sorry, no posts matched your criteria.</p>
<!-- REALLY stop The Loop. -->
<?php endif; ?>
try that loop above. You can see the if(in_category(5)) part of the loop. Try it and see if it works. If it does, you can modify it to show the amount of posts that you want
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$args = array(
'paged' => $paged,
'posts_per_page' => 5,
'caller_get_posts' => 0,
if you check the url after clicking on the two, you can see the address is wrong. I don't know how to fix it for you. Sorry
http://css-tricks.com/video-screencasts/91-the-wordpress-loop/
It really is way more complicated than it should be. But WordPress is still growing into a functioning CMS, I'm sure things like this will get taken care of eventually.