Pagination - Non-JavaScript fallback


#1

Is it possible to use standard pagination on the media gallery page instead of the JavaScript pagination?


#2

Yes you could do that by removing the ids from the prev and next links in your template as the click is bound to the ids.


#3

Thanks, that worked great.


#4

@joshuaabenazer

Does the pagination supposed to output page numbers? e.g:

Prev 1 2 3 4 5 Next

Or does it just output previous and next links? e.g:

Prev Next


#5

It currently outputs “Prev Next” links. You could maybe try using paginate_links() with suitable arguments to get the page number wise links.


#6

I am using this but the function doesn’t seem to output anything to the page

<?php  
$args = array(  
	'base'         => '%_%',  
	'format'       => '?page=%#%',  
	'total'        => 1,  
	'current'      => 0,  
	'show_all'     => False,  
	'end_size'     => 1,  
	'mid_size'     => 2,  
	'prev_next'    => True,  
	'prev_text'    => __('Prev'),  
	'next_text'    => __('Next'),  
	'type'         => 'plain',  
	'add_args'     => False,  
	'add_fragment' => ''  
);  
	paginate_links( $args );   
?>

Do you think it’ll work if I changed some of the default arguments?


#7

Hi,
It would actually be tough to try to generate page links through paginate_links() since it relies/depends on the global $wp_query. Looks like the pagination would have to be custom built in the same way the previous and next links are created.


#8

I see. I think custom pagination is beyond my ability haha. Thanks for looking into it :slight_smile:


#9