from the linked tut:
<?php if (function_exists("pagination")) {
pagination($additional_loop->max_num_pages);
} ?>
this $additional_loop
depends on your used query;
for a ‘normal’ loop this might need to be replaced with $wp_query
it might help if you paste the full code of your template into a pastebin and post the link to it here – see http://codex.wordpress.org/Forum_Welcome#Posting_Code
Thread Starter
sh_son
(@sh_son)
Thank you, alchymyth.
I have posted the template code into pastebin here.
As of now I do not have any functions/code relating to pagination, as it kept failing to work.
Thread Starter
sh_son
(@sh_son)
I would also like to add that pagination plugins such as ‘WP-paginate’ does not work.
I’d only assume that I am missing a key piece of code, still going through google search and WordPress documentations.
add the ‘paged’ parameter to this line:
<?php $the_query = new WP_Query('showposts = 5');?>
like:
<?php $the_query = new WP_Query('posts_per_page = 5 & paged = ' . get_query_var('paged'));?>
then try for instance these basic pagination links somewhere after the <?php endwhile;?>
<?php next_posts_link('Older Entries »', $the_query->max_num_pages); ?>
<?php previous_posts_link('Newer Entries', $the_query->max_num_pages); ?>
http://codex.wordpress.org/Class_Reference/WP_Query
http://codex.wordpress.org/Function_Reference/next_posts_link
http://codex.wordpress.org/Function_Reference/previous_posts_link
Hey Guys ,
Must use
global $paged,$wp_query;