I would like to add pagination above my posts on wordpress blog page, where should I place the code? I'm using:
<?php
$big = 999999999; // need an unlikely integer
echo paginate_links( array( ..parameters here.. ) );
?>
and a custom loop. If I place it below the loop it works fine, if I place it above the loop it doesn't show up. Is there solution for this?
My lopp looks something like:
<?
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
$args = array(
'paged' => $paged,
'posts_per_page'=>12,
'orderby' => 'meta_value_num',
'order' => 'DSC',
'pagination' => 'true',
'cat' => '2'
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
?>
<?php $the_query->the_post(); ?>
<li id="post-<?php the_ID(); ?>"> ...</li> ....