Title: Shortcode does not work with CPT
Last modified: July 31, 2019

---

# Shortcode does not work with CPT

 *  Resolved [jaswinder657](https://wordpress.org/support/users/jaswinder657/)
 * (@jaswinder657)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/shortcode-does-not-work-with-cpt/)
 * Hi, I am trying to call the shortcode in sidebar
 * [SimpleYearlyArchive posttype=”my post type slug”]
 * It keeps showing me the yearly archive of blog page posts and not for my CPT.
 * I tried the filter as well, provided here – [https://wordpress.org/plugins/simple-yearly-archive/#how%20can%20i%20change%20query%20parameters%3F](https://wordpress.org/plugins/simple-yearly-archive/#how%20can%20i%20change%20query%20parameters%3F)
 * with post_type query argument of WP_Query, then it doesn’t work at all.
 * Any thoughts?

Viewing 1 replies (of 1 total)

 *  Plugin Author [wpseek](https://wordpress.org/support/users/alphawolf/)
 * (@alphawolf)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/shortcode-does-not-work-with-cpt/#post-11786589)
 * Hi,
 * have you tried using the post type ID instead of the post type slug in the shortcode?
 * `[SimpleYearlyArchive posttype="<your post type ID>"]`
    -  This reply was modified 6 years, 10 months ago by [wpseek](https://wordpress.org/support/users/alphawolf/).

Viewing 1 replies (of 1 total)

The topic ‘Shortcode does not work with CPT’ is closed to new replies.

 * ![](https://ps.w.org/simple-yearly-archive/assets/icon-256x256.png?rev=1162212)
 * [Simple Yearly Archive](https://wordpress.org/plugins/simple-yearly-archive/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-yearly-archive/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-yearly-archive/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-yearly-archive/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-yearly-archive/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-yearly-archive/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [wpseek](https://wordpress.org/support/users/alphawolf/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/shortcode-does-not-work-with-cpt/#post-11786589)
 * Status: resolved