Hey Dude, I found the way to get the pagination fix!!
first thing you need to know is do not add custom query_posts at your taxonomy.php it will ruin the pagination so get rid of it.
second remove the exclude_from_search -> true while registering the post type
third don’t register custom taxonomy with priority lower than priority for registering associated post type.
example
add_action('init', 'custom_post_type_register', 0);
add_action('init', 'custom_tax_register', 10);
if you want to add custom query to your taxonomy instead of using query_posts, just create another functions in functions.php then using pre_get_posts filter
function search_filter($query) {
if ( !is_admin() ) {
if ($query->is_search) {
$query->set('post_type', array('post', 'page'));
}
}
return $query;
}
add_filter('pre_get_posts', 'search_filter');
This is use to filter the search to only search for post and page if you want to add the custom post type just append it in to the array.
if you want to make custom post per page use this functions
$option_posts_per_page = get_option( 'posts_per_page' );
$option_taxposts_per_page = (int)(get_option('my_custom_option');
if($option_taxposts_per_page['st_search_results_show'] == ''){ $option_taxposts_per_page = $options_posts_per_page;}
add_action( 'init', 'my_modify_posts_per_page', 0);
function my_modify_posts_per_page() {
add_filter( 'option_posts_per_page', 'my_option_posts_per_page' );
}
function my_option_posts_per_page( $value ) {
global $option_posts_per_page;
global $option_taxposts_per_page; // your custom posts per page options
if ( is_tax( 'mytaxonomy')) {
return $option_taxposts_per_page;
}
else {
return $option_posts_per_page;
}
}