Q: Adding pagination on custom taxonomies in foreach loop I am trying to paginate my custom template in WordPress but pagination is not showing up the thing is that I need to add pagination in foreach loop but after so many false attempts and so much searching I am posting it here here is the code that I am using if anyone can give me any hint would be great here is the code I am using
$page = ( get_query_var('page') ) ? get_query_var('page') : 1;

$per_page = 2;

$number_of_series = count(get_terms('categories'));
$offset = ( $page - 1 ) * $per_page;

$term_args = array(
   'number' => $per_page,
   'offset' => $offset
);

$terms = get_terms('wcpv_product_vendors', $term_args);
foreach ($terms as $term) {
   $term_meta = get_term_meta($term->term_id);
   $admin = unserialize($term_meta['vendor_data'][0]);
   if (is_array($admin['admins'])) {
        $user_id = $admin['admins'][0];
   } else {
        $user_id = $admin['admins'];
   }
   if (in_array('logo', $admin)) {
       $logo_id = $admin['logo'];
   } else {
       $logo_id = '';
   }
   $user = get_userdata($user_id);
   $term_name = $term->name;
   $user_name = $user->data->display_name;
   $attachment = get_post($logo_id);

And for displaying the pagination I am using the following code.
<?php
$big = 999999999; // need an unlikely integer

echo paginate_links(array(
    'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
    'format' => '?paged=%#%',
    'prev_next' => True,
    'current' => max(1, get_query_var('number')),
    'total' => $wp_query->max_num_pages
));
?>

I can't seem to find what is wrong I am doing here sorry if this question is basic as I have never used pagination in foreach loop in WordPress. Any help would be great.
