Title: Include only current category?
Last modified: June 12, 2017

---

# Include only current category?

 *  [barden](https://wordpress.org/support/users/barden/)
 * (@barden)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/include-only-current-category/)
 * I’m trying to figure out if Collapsing Archives in some way could dynamically
   include the category which the user is currently viewing.
 * I have tried putting a PHP “get current category name” code snippet into the 
   widget’s “Include these categories” input field. It was a long shot but worth
   a try.
 * I then tried to enter the shortcode into the plugin [PHP Code Widget](https://wordpress.org/plugins/php-code-widget/)
   to start Collapsing Archives manually and get more control. I’ve tried the following
   codes but nothing have worked so far.
    `collapsArch();` `<?php collapsArch();?
   >` `<script> collapsArch(); </script>`
 * It shouldn’t be this complicated so clearly I’m missing something. Help me, whoever,
   you’re my only hope!

The topic ‘Include only current category?’ is closed to new replies.

 * ![](https://ps.w.org/collapsing-archives/assets/icon-256x256.gif?rev=2550328)
 * [Collapsing Archives](https://wordpress.org/plugins/collapsing-archives/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/collapsing-archives/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/collapsing-archives/)
 * [Active Topics](https://wordpress.org/support/plugin/collapsing-archives/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/collapsing-archives/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/collapsing-archives/reviews/)

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)

 * 0 replies
 * 1 participant
 * Last reply from: [barden](https://wordpress.org/support/users/barden/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/include-only-current-category/)
 * Status: not resolved