If you are using “page-template”s you’ll have problems with pagination since pages are not meant to display posts and some people frown upon using page-templates for custom archive display, but it’s sometimes the simplest way.

Anyway the solution is 1.) to nullify the global $wpquery 2.) adding  ‘paged’ => $paged arg. before displaying your posts in a custom page template.

$myargs=array(
		'post_type' => 'my_custom_type',
		'post_status' => 'publish',
		'ignore_sticky_posts'=> 1,  
		'post__in' => $majids,

		'paged' => $paged
	);
	$myquery = new WP_Query( $myargs );

// Pagination fix
$wp_query   = NULL;
$wp_query   = $majquery;

 if ( $majquery->have_posts()) : while ($majquery->have_posts()) : $majquery->the_post();
 // ... Loop here

 

Bir cevap yazın

E-posta hesabınız yayımlanmayacak.