'paging', 'container_class' => 'group', 'prev_text' => esc_html__( 'Previous page', 'brittany-light' ), 'next_text' => esc_html__( 'Next page', 'brittany-light' ), 'paginate_links_args' => array() ) ) ); if ( 'object' != gettype( $query ) || 'WP_Query' != get_class( $query ) ) { global $wp_query; $query = $wp_query; } // Set things up for paginate_links() $unreal_pagenum = 999999999; $permastruct = get_option( 'permalink_structure' ); $paginate_links_args = wp_parse_args( $args['paginate_links_args'], array( 'base' => str_replace( $unreal_pagenum, '%#%', esc_url( get_pagenum_link( $unreal_pagenum ) ) ), 'format' => empty( $permastruct ) ? '&page=%#%' : 'page/%#%/', 'total' => $query->max_num_pages, 'current' => max( 1, get_query_var( 'paged' ), get_query_var( 'page' ) ), ) ); $method = get_theme_mod( 'pagination_method', 'numbers' ); if ( $query->max_num_pages > 1 ) { ?>