Pagination is not working on taxonomy.php. Here is my code for register custom post type and taxonomy
add_action(\'init\', \'ep_add_equipment\');
function ep_add
// get the global query object
global $wp_query;
// get the correct page var
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
// create the page argument
$args= array('paged'=> $paged);
// merge the page argument array with the original query array
$args = array_merge( $wp_query->query, array( 'post_type' => 'equipment' ) );
// Re-run the query with the new arguments
query_posts( $args );
May be you need to enable search to enable pagination
While declaring custom taxonomy you should disable search excluding.
exclude_from_search => false
This fixed my problem. I have very hard time to find this solution. Hope this helps everyone.
My code is:
register_post_type( 'lifestyle',
array(
'label' => __('Lifestyle', 'tmi'),
'public' => true,
'show_ui' => true,
'show_in_nav_menus' => true,
'rewrite' => true,
'hierarchical' => true,
'menu_position' => 5,
'exclude_from_search' =>false,
'supports' => array(
'title',
'editor',
'thumbnail',
'excerpt',
'revisions')
)
);
register_taxonomy('lifestylecat', __('lifestyle', 'tmi'),array('hierarchical' => true, 'label' => __('Categories', 'tmi'), 'singular_name' => __('Category', 'tmi'))
);