str_replace($big, '%#%', get_pagenum_link($big) ),
'current' => max(1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages,
'mid_size' => 5,
'prev_next' => True,
'prev_text' => __('«'),
'next_text' => __('»'),
'type' => 'list'
) );
// Display the pagination if more than one page is found
if ($paginate_links ) {
echo '
';
}
}
}
/**
* A fallback when no navigation is selected by default, otherwise it throws some nasty errors in your face.
* From required+ Foundation http://themes.required.ch
*/
if(!function_exists('arefly_v1_menu_fallback' ) ) {
function arefly_v1_menu_fallback() {
echo '';
// Translators 1: Link to Menus, 2: Link to Customize
printf(__('Please assign a menu to the primary menu location under %1$s or %2$s the design.', 'arefly-v1' ),
sprintf(__('
Menus', 'arefly-v1' ),
get_admin_url(get_current_blog_id(), 'nav-menus.php' )
),
sprintf(__('
Customize', 'arefly-v1' ),
get_admin_url(get_current_blog_id(), 'customize.php' )
)
);
echo '
';
}
}
// Add Foundation 'active' class for the current menu item
if(!function_exists('arefly_v1_active_nav_class' ) ) {
function arefly_v1_active_nav_class($classes, $item ) {
if ($item->current == 1 || $item->current_item_ancestor == true ) {
$classes[] = 'active';
}
return $classes;
}
}
add_filter('nav_menu_css_class', 'arefly_v1_active_nav_class', 10, 2 );
/**
* Use the active class of ZURB Foundation on wp_list_pages output.
* From required+ Foundation http://themes.required.ch
*/
if(!function_exists('arefly_v1_active_list_pages_class' ) ) {
function arefly_v1_active_list_pages_class($input ) {
$pattern = '/current_page_item/';
$replace = 'current_page_item active';
$output = preg_replace($pattern, $replace, $input );
return $output;
}
}
add_filter('wp_list_pages', 'arefly_v1_active_list_pages_class', 10, 2 );
?>