In what template file are you using this? index.php?
hi sushant,
use page numbers plugin or wp paginate.
If still not solved after ending your loop with pagination do wp reset query
Yes. I’m using this in index.php template file.
Try changing this:
<?php elseif ( have_posts() ) : ?>
to this:
<?php else : ?>
<?php if ( have_posts() ) : ?>
And put another endif
at the bottom of the page:
<?php endif; ?>
<?php endif; ?>
btw:
consider creating a child theme instead of editing your theme directly – if you upgrade the theme all your modifications will be lost.
Hello Sonal!
Forgot to mention. I tried with WP-Paginate plugin, but failed to get any solution.
As I’m a newbie for WordPress, please where should I write the rest query!!
Thanks!!
Sushant
Have you tried the modifications?
Hello Keesie!
I changed the code as mentioned but the problem persists.
Any other way around???
Thanks!
Kindly use wp page numbers plugin and let us know if it solved the issue
What theme are you using and where did you download it.
It’s a custom theme I used.
Any code which is important and I’m not sharing??
Can you post the monkeytheme_pagination() function.
I recommend you use the pagination functions that come with WordPress or use a plugin as sonalsinha21 suggested.
http://codex.wordpress.org/Pagination#Function_Reference
for numbered pagination use wp_link_pages (see the example): http://codex.wordpress.org/Function_Reference/paginate_links
or a plugin:
http://wordpress.org/plugins/wp-pagenavi
Ok Keesie.
I’ll try your and sonal suggestions and get back, though I’ve a question.
As I mentioned earlier, I’m retrieving posts from “News” and “Events”, would these plugins give an option of same.
Thanks
The plugin and functions will paginate the loop with the query (“News” and “Events”) and the normal loop if you’re not on the home page without you having to do anything.
Just to be sure can you paste the full code from index.php into a pastebin.