0 ? 'Chapters' : 'Collections'; $collection_comic_order = get_option('toocheke-collection-first-comic') ? get_option('toocheke-collection-first-comic') : 'ASC'; ?>
'collections' ); $all_active_collection_list = get_categories( $total_args ); $total_active_collections = count( $all_active_collection_list); //start paging $collection_paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $collection_per_page = 60; $total_number_of_pages = ceil($total_active_collections/$collection_per_page); $paged_offset = ($collection_paged - 1) * $collection_per_page; //setup paginate args $paginate_args = array( 'parent' => $collection_id, 'taxonomy' => 'collections', 'style' => 'none', 'orderby' => 'meta_value_num', 'order' => $collection_comic_order, 'meta_query' => array( array( 'key' => 'collection-order', 'type' => 'NUMERIC', )), 'show_count' => 0, 'number' => $collection_per_page, 'paged' => $collection_paged, 'offset' => $paged_offset ); $paged_collections_list = get_categories($paginate_args); if ( $paged_collections_list ) { ?>
1, 'post_type' => 'comic', 'orderby' => 'post_date', 'order' => $collection_comic_order, "tax_query" => array( array ( 'taxonomy' => "collections", // use the $tax you define at the top of your script 'field' => 'term_id', 'terms' => $collection->term_id, // use the current term in your foreach loop ), ), 'no_found_rows' => true, 'update_post_meta_cache' => false, 'update_post_term_cache' => false ); $first_comic_query = new WP_Query( $args ); // The Loop while ( $first_comic_query->have_posts() ) : $first_comic_query->the_post(); $link_to_first_comic = add_query_arg ('col', $collection->term_id, get_post_permalink()); // Display the image of the first post in category endwhile; printf( wp_kses_data( '%1$s'), ''; } // Reset Post Data wp_reset_postdata(); ?>

str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $total_number_of_pages, 'prev_text' => wp_kses(__('', 'toocheke' ), array('i' => array('class' => array()))), 'next_text' => wp_kses(__( '', 'toocheke' ), array('i' => array('class' => array()))) ) ); if ( $links ) : ?>