WP Pagination not working in category.php
-
Hi,
I can’t seem to get WP Paginate to work on the category.php page. I’m using a custom post type. Below the code I’m using:
<?php $custom_post_type = 'kb'; $article = get_term(get_queried_object()->term_id, 'category'); $taxonomy_child = $article->slug; $article = new WP_Query( array( 'post_type' => $custom_post_type, 'category' => $taxonomy_child, 'orderby' => 'name', 'order' => 'ASC' )); if ( $article->have_posts() ) : ?> <ul class="article-links"> <?php if ( $article->have_posts() ) : while ( $article->have_posts() ) : $article->the_post(); ?> <li> <a href="<?php echo get_permalink(); ?>" title="<?php the_title(); ?>"><i class="fa fa-file-text-o"></i><?php the_title(); ?></a> </li> <?php endwhile; else: ?> </ul> <p><?php _e( 'No artike;', 'kb' ); ?></p> <?php endif; wp_reset_query(); if(function_exists('wp_paginate')) { wp_paginate(); } ?>
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘WP Pagination not working in category.php’ is closed to new replies.