Title: Shortcode on Post affecting Condition Groups
Last modified: August 22, 2016

---

# Shortcode on Post affecting Condition Groups

 *  Resolved [tnault](https://wordpress.org/support/users/tnault/)
 * (@tnault)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/shortcode-on-post-affecting-condition-groups/)
 * I have a few sidebars set up for different items; Blog, Gallery, and Products.
   I am using a woocommerce for a shop and use my Product sidebar customize for 
   those pages. On the Gallery posts I am using a shortcode to display related Products
   based on matching tags. When using this shortcode the Gallery post shows the 
   sidebar for Products. When I remove the shortcode the Gallery post shows the 
   correct sidebar that I have configured for Gallery posts.
 * Website is exposurephotoworks.com..Any thoughts on what could be causing this?
 * Thanks,
    -Tim
 * [https://wordpress.org/plugins/content-aware-sidebars/](https://wordpress.org/plugins/content-aware-sidebars/)

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

 *  Thread Starter [tnault](https://wordpress.org/support/users/tnault/)
 * (@tnault)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/shortcode-on-post-affecting-condition-groups/#post-5507486)
 * Some additional details. The shortcode I am using is custom and can be seen at..
   [http://www.remicorson.com/list-woocommerce-products-by-tags/](http://www.remicorson.com/list-woocommerce-products-by-tags/)
 *  Plugin Author [Joachim Jensen](https://wordpress.org/support/users/intoxstudio/)
 * (@intoxstudio)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/shortcode-on-post-affecting-condition-groups/#post-5507712)
 * Thank you for your detailed feedback.
 * Most often when a sidebar is not displayed where it ought to, the cause is an
   external mechanism (plugin, theme) “messing” with the [Conditional Tags](http://codex.wordpress.org/Conditional_Tags)
   in WordPress.
    This makes your WordPress site think that another type of content
   is being viewed.
 * Looking at the code in the link you provided, this seems also to be the case 
   here.
 * Can you insert `wp_reset_postdata();` after `endwhile;` on line 61?
 *  Thread Starter [tnault](https://wordpress.org/support/users/tnault/)
 * (@tnault)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/shortcode-on-post-affecting-condition-groups/#post-5507752)
 * Worked like a charm. Thanks!
 *  Plugin Author [Joachim Jensen](https://wordpress.org/support/users/intoxstudio/)
 * (@intoxstudio)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/shortcode-on-post-affecting-condition-groups/#post-5507808)
 * Great! If you have any more problems or questions, do not hesitate to open a 
   new thread.

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

The topic ‘Shortcode on Post affecting Condition Groups’ is closed to new replies.

 * ![](https://ps.w.org/content-aware-sidebars/assets/icon-256x256.png?rev=1815877)
 * [Content Aware Sidebars - Fastest Widget Area Plugin](https://wordpress.org/plugins/content-aware-sidebars/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/content-aware-sidebars/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/content-aware-sidebars/)
 * [Active Topics](https://wordpress.org/support/plugin/content-aware-sidebars/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/content-aware-sidebars/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/content-aware-sidebars/reviews/)

## Tags

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

 * 4 replies
 * 2 participants
 * Last reply from: [Joachim Jensen](https://wordpress.org/support/users/intoxstudio/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/shortcode-on-post-affecting-condition-groups/#post-5507808)
 * Status: resolved