I'm building a themes option panel and want users to be able to choose between Next/Previous links or pagination in my archives and homepage.
I need help combining the two functions below (pagination and next previous) to create a function which chooses based on the user's selection.
I figure the function I add to the options panel will look like this:
array( "name" => "Paginate or next/previous links?",
"desc" => "Choose your option",
"id" => $shortname."_next_prev_or_paginate",
"type" => "select",
"options" => array("Next/Previous Links", "Pagination"),
"std" => ""),
Here's how I'm calling the pagination:
<?php
global $wp_query;
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages
) );
?>
Here's how I call next/prev links:
<?php previous_posts_link ('Newer') ?>
<?php next_posts_link('Older') ?>