Exemple #1
0
function chy_pagging($wp_query) {
    
    $effect_class = "charity-paging-effect";//(ot_get_option('paging_effect') != "") ? ot_get_option('paging_effect'): 'cl-effect-2';
    
    $total = $wp_query->max_num_pages;

    // only bother with the rest if we have more than 1 page!
    if ($total > 1) {
        // get the current page
        if (!$current_page = get_query_var('paged'))
            $current_page = 1;
        // structure of "format" depends on whether we're using pretty permalinks
        if (get_option('permalink_structure')) {
            $format = '/page/%#%/';
        } else {
            $format = '/%#%/';
        }
        $big = 999999999;
        echo "<div class='cols-xs-12 anim-section text-center animate charity-paging'>";
        echo chy_paginate_links(array(
            'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))), //get_pagenum_link(1) . '%_%',
            'format' => $format,
            'current' => $current_page,
            'total' => $total,
            'mid_size' => 2,
            'end_size' => 1,
            'effect_class' => $effect_class
        ));
        echo '</div>';
    }
}
Exemple #2
0
<?php

/**
 * Pagination - Show numbered pagination for catalog pages.
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     2.2.2
 */
if (!defined('ABSPATH')) {
    exit;
    // Exit if accessed directly
}
global $wp_query;
if ($wp_query->max_num_pages <= 1) {
    return;
}
?>
<nav class="woocommerce-pagination charity-woocommerce-pagining">
	<?php 
echo chy_paginate_links(apply_filters('woocommerce_pagination_args', array('base' => esc_url_raw(str_replace(999999999, '%#%', remove_query_arg('add-to-cart', get_pagenum_link(999999999, false)))), 'format' => '', 'add_args' => '', 'current' => max(1, get_query_var('paged')), 'total' => $wp_query->max_num_pages, 'end_size' => 1, 'mid_size' => 2)));
?>
</nav>