Title: Get current category posts
Last modified: July 16, 2017

---

# Get current category posts

 *  Resolved [topitoconnectey](https://wordpress.org/support/users/topitoconnectey/)
 * (@topitoconnectey)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/get-current-category-posts/)
 * Hi! 🙂
    I’m using the shortcode in archive.php to display the list of posts. 
   The problem is that whatever category page i’m on, I get all of the posts.
 * How can I limit the ajax load more query to only the current category posts ?
 * Here’s my code
 *     ```
       <?php if (have_posts()) : ?>
   
           <?php echo do_shortcode('[ajax_load_more container_type="div" css_classes="row" post_type="post" posts_per_page="3" category="" scroll_distance="300" transition="fade" transition_container="false" progress_bar="false" progress_bar_color="15A3C6" button_label="Charger d\'autres articles" button_loading_label="Chargement..."]'); ?>  
   
       <?php endif; ?>
       ```
   
 * Thank you

Viewing 1 replies (of 1 total)

 *  Plugin Author [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * (@dcooney)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/get-current-category-posts/#post-9323669)
 * There are examples of this directly inside the plugin under Help and as well 
   here ->
    [https://connekthq.com/plugins/ajax-load-more/docs/code-samples/category-archives/](https://connekthq.com/plugins/ajax-load-more/docs/code-samples/category-archives/)
 * Thanks,

Viewing 1 replies (of 1 total)

The topic ‘Get current category posts’ is closed to new replies.

 * ![](https://ps.w.org/ajax-load-more/assets/icon-256x256.png?rev=2944639)
 * [Ajax Load More – Infinite Scroll, Load More, & Lazy Load](https://wordpress.org/plugins/ajax-load-more/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ajax-load-more/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ajax-load-more/)
 * [Active Topics](https://wordpress.org/support/plugin/ajax-load-more/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ajax-load-more/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ajax-load-more/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Darren Cooney](https://wordpress.org/support/users/dcooney/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/get-current-category-posts/#post-9323669)
 * Status: resolved