Need help with pagination that doesn't work
-
I am using Cosmothemes News 24, and pagination doesn’t work properly on my site. Clicking any “next” links just bumps me back to the main page of the site.
I think this has to do with our server’s settings (which I am not permitted to alter) interfering with the resetting of permalinks.
The pagination code in the template is posted below. Does anyone have any suggestions for how I can create working pagination without having to reset permalinks?
<?php global $wp_rewrite; $paged > 1 ? $current = $paged : $current = 1; $pagination = array( 'base' => @add_query_arg('paged','%#%'), 'format' => '', 'total' => $posts->max_num_pages, 'current' => $current, 'show_all' => false, 'prev_next'=> true, 'prev_text'=> '«' . __( 'Previous' , 'cosmotheme' ), 'next_text'=> __( 'Next' , 'cosmotheme' ) . ' »', 'type' => 'array' ); if( $wp_rewrite->using_permalinks() ) $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' ); if( !empty($posts->query_vars['s']) ) $pagination['add_args'] = array( 's' => get_query_var( 's' ) ); $pgn = paginate_links( $pagination ); if( !empty( $pgn ) ){ echo '<div class="pag">'; echo '<ul class="b_pag center p_b">'; if( $current == 1 ){ $current--; } foreach($pgn as $k => $link){ print '<li>'.str_replace('class="prev ','class="no_link ',str_replace('class="next ','class="no_link ',str_replace("'",'"',$link) ) ).'</li>'; } echo '</ul>'; echo '</div>'; } ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Need help with pagination that doesn't work’ is closed to new replies.