Produce pretty pagination URL with Views

Yeah, our Views pagination URL is ugly.
It produces stuff like `example.com/type/?wpv_view_count=147-TCPID79&wpv_paged=2`

This is required for several features, as example AJAX pagination might not work if you do not use above URL format (which is native to Views)

What one can do is customize this a bit.
You need this Plugin:

WP-PageNavi

Then this code in your theme’s functions.php:

// Get the page number into wp_pagenavi
function pagenavi_paged($q) {
$types = (array)$q->get('post_type');
if (in_array('test', $types)) {
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$q->set('paged', $paged);
}

}
add_action('pre_get_posts', 'pagenavi_paged');

// create pagination shortcode
function custom_pagenavi($args, $content) {
global $WP_Views;
wp_pagenavi( array('query' => $WP_Views->post_query) );
}
add_shortcode('custom-pagination', 'custom_pagenavi');

If you do not restrict this on post types, then use this:

// Get the page number into wp_pagenavi
function pagenavi_paged($q) {

$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$q->set('paged', $paged);

}
add_action('pre_get_posts', 'pagenavi_paged');

// create pagination shortcode
function custom_pagenavi($args, $content) {
global $WP_Views;
wp_pagenavi( array('query' => $WP_Views->post_query) );
}
add_shortcode('custom-pagination', 'custom_pagenavi');

Keep in mind that this is custom code that we cannot debug or provide in-depth explanations and customizations.

Change the URL of the CPT’s archive

Let’s imagine you have a CPT called “Business” and want to access its archive through mysite.com/businesses. But also access the single page through mysite.com/business/otgsystems. Singular for single page and plural for archive.
You have to open the permalinks page and then save changes.
You can also use Toolset > Post Types > your_post_type > Edit > Options > Rewrite post slug and archive.

function codex_custom_init() {
    $args = array(
      'public' => true,
      'has_archive' => 'businesses'
    );
    register_post_type( 'business', $args );
}
add_action( 'init', 'codex_custom_init' );