I have a custom function which allows users to choose between next/previous links and pagination and I'm attempting to add CSS classes to the next/previous links. I've tried this multiple ways and keep crashing my theme.
How do I insert CSS classes into the previous and next link?
// Pagination
function my_theme_navigation()
{
global $shortname;
if( get_option( $shortname . '_next_prev_or_paginate' ) == 'Next' ) :
// the block for next-prev navigation
previous_posts_link ('Newer');
next_posts_link('Older');
else :
// the block for pagination
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
)
);
endif;
}
For an example, check the bottom of this page: http://themeforward.com/demo2/