Title: wp_get_archives problem&#8230;
Last modified: May 8, 2017

---

# wp_get_archives problem…

 *  Resolved [Dharator](https://wordpress.org/support/users/dharator/)
 * (@dharator)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/wp_get_archives-problem/)
 * Hello, i’ve tried to use the wp_get_archives that comes with this plugin (cptda_get_archives),
   but can’t seem to make it work… this is what i tried:
 *     ```
       <select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
         <option value=""><?php echo esc_attr( __( 'Select Month' ) ); ?></option> 
         <?php cptda_get_archives( array( 'post_type' => 'my-post-type', 'type' => 'monthly', 'format' => 'option', 'show_post_count' => 1 ) ); ?>
       </select>
       ```
   
 * Yet it displays nothing…

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Dharator](https://wordpress.org/support/users/dharator/)
 * (@dharator)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/wp_get_archives-problem/#post-9106997)
 * Ok… apparently i can’t use it the same way as wp_get_archives with the options
   in an array, had to use it like this:
 *     ```
       <select name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
         <option value=""><?php echo esc_attr( __( 'Select Month' ) ); ?></option> 
         <?php cptda_get_archives( 'post_type=my-post-type&type=monthly&format=option&show_post_count=1' );; ?>
       </select>
       ```
   
 * The documentation isn’t very clear about this and this kind of example is not
   listed in the codex for wp_get_archives, you should consider updating you documentation
   and maybe add some examples, the code that worked for me is the one in this response
   in case anyone else has the same problem as i did.
 * Everything else work great btw, leaving a good review.
    -  This reply was modified 9 years, 1 month ago by [Dharator](https://wordpress.org/support/users/dharator/).
    -  This reply was modified 9 years, 1 month ago by [Dharator](https://wordpress.org/support/users/dharator/).
 *  Plugin Author [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/wp_get_archives-problem/#post-9107684)
 * Hi Dharator
 * Thanks for the review 🙂
 * It should both work with an array or string. Maybe you discovered a bug. I will
   let you know if I find anything regarding your issue.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘wp_get_archives problem…’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-post-type-date-archives_ffffff.
   svg)
 * [Custom Post Type Date Archives](https://wordpress.org/plugins/custom-post-type-date-archives/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-type-date-archives/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-type-date-archives/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-type-date-archives/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-type-date-archives/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-type-date-archives/reviews/)

## Tags

 * [archives](https://wordpress.org/support/topic-tag/archives/)
 * [dropdown](https://wordpress.org/support/topic-tag/dropdown/)
 * [Post Types](https://wordpress.org/support/topic-tag/post-types/)

 * 2 replies
 * 2 participants
 * Last reply from: [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/wp_get_archives-problem/#post-9107684)
 * Status: resolved