I have blog with categories and sub-categories and use category.php for archive of main category posts, and added a custom layout for subcategory archive layout as subcategory.php (with a function). In this subcategory archive page, I need a numbered pagination but all I did it returns to 404 Not Found, here my code : function […]
- Tags 'current' => $current_page, 'field' => 'slug', 'format' => '/page/%#%', 'hide_empty' => true, 'next_text' => __( '»', 'numberposts' => -1, 'order' => 'DESC', 'orderby' => 'date', 'post_status' => 'publish', 'post_type' => 'blog', 'posts_per_page' => 2, 'prev_text' => __( '«', 'tax_query' => array( array( 'taxonomy' => 'category', 'terms' => 'featured', 'total' => $total_pages, 'wpd_subcategory_template'); then in subcategory.php : $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args_news = array(, ), ); $sub_cat_news = new WP_Query($args_news); while ($sub_cat_news->have_posts()) : $sub_cat_news->the_post(); get_template_part('....');, )); } wp_reset_postdata(); the query and tax_query works fine and I have all post of this subcategory. I have 10 posts in this subc, $current_page); echo paginate_links(array( 'base' => get_pagenum_link(1) . '%_%', and added a custom layout for subcategory archive layout as subcategory.php (with a function). In this subcategory archive page, get_query_var('paged')); define('CURRENT_PAGE', here my code : function for custom layout (in fucntions.php): function wpd_subcategory_template($template) { $cat = get_queried_object(, I have blog with categories and sub-categories and use category.php for archive of main category posts, I need a numbered pagination but all I did it returns to 404 Not Found, Thanks, type: list