Title: Apparent shortcode bug
Last modified: February 1, 2019

---

# Apparent shortcode bug

 *  Resolved [lars00](https://wordpress.org/support/users/lars00/)
 * (@lars00)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/apparent-shortcode-bug/)
 * Been having this error for a few months, up to the latest current version.
 * I’m having an issue with one shortcode, which looks like:
    [products limit=”6″
   columns=”3″ orderby=”id” order=”DESC” visibility=”visible”]
 * The problem I’m having is that it sometimes renders the li wrong, which messes
   up the layout.
 * 1. I’m importing new products through a plugin I’ve written myself, using “new
   WC_Product()”. Everything works, most of the time but…
 * 2. Every once in a blue moon something happens to a product. It looks the same
   everywhere except when used in a shortcode. It then renders the `li` wrong, as
   such:
 *     ```
       <li class="">
       <a href="" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"><div class="wc-product-image"><div class="inside-wc-product-image"><img width="300" height="300" src="https://website.com/wp-content/uploads/2019/01/2666238763-300x300.jpg" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt="" srcset="https://website.com/wp-content/uploads/2019/01/2666238763-300x300.jpg 300w, https://website.com/wp-content/uploads/2019/01/2666238763-150x150.jpg 150w, https://website.com/wp-content/uploads/2019/01/2666238763-100x100.jpg 100w" sizes="(max-width: 300px) 100vw, 300px"></div></div><h2 class="woocommerce-loop-product__title"></h2><div class="star-rating" title="Not yet rated"><span style="width:0%"><strong class="rating">0</strong> out of 5</span></div>
       <span class="price"><span class="woocommerce-Price-amount amount">119,900<span class="woocommerce-Price-currencySymbol">kr</span></span></span>
       </a><a href="https://website.com/produkt/saab-9-3-aero-v6-2-8-turbo-280hk-xwd-08/" data-quantity="1" class="button product_type_blocket add_to_cart_button" data-product_id="3257" data-product_sku="blocket_83043361" aria-label="Läs mer om “Saab 9-3 Aero V6 2.8 Turbo 280hk XWD -08&rdquo;" rel="nofollow">Läs mer</a></li>
       ```
   
 * instead of the correct:
 *     ```
       <li class="post-3257 product type-product status-publish has-post-thumbnail product_cat-produkter sales-flash-overlay woocommerce-text-align-center woocommerce-image-align-center wc-has-gallery last instock shipping-taxable purchasable product-type-blocket">
       	<a href="https://website.com/produkt/saab-9-3-aero-v6-2-8-turbo-280hk-xwd-08/" class="woocommerce-LoopProduct-link woocommerce-loop-product__link"><div class="wc-product-image"><div class="inside-wc-product-image"><img width="300" height="300" src="https://website.com/wp-content/uploads/2019/01/2674762082-300x300.jpg" class="secondary-image attachment-shop-catalog" alt="" srcset="https://website.com/wp-content/uploads/2019/01/2674762082-300x300.jpg 300w, https://website.com/wp-content/uploads/2019/01/2674762082-150x150.jpg 150w, https://website.com/wp-content/uploads/2019/01/2674762082-100x100.jpg 100w" sizes="(max-width: 300px) 100vw, 300px" style="opacity: 0;"><img width="300" height="300" src="https://website.com/wp-content/uploads/2019/01/2666238763-300x300.jpg" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt="" srcset="https://website.com/wp-content/uploads/2019/01/2666238763-300x300.jpg 300w, https://website.com/wp-content/uploads/2019/01/2666238763-150x150.jpg 150w, https://website.com/wp-content/uploads/2019/01/2666238763-100x100.jpg 100w" sizes="(max-width: 300px) 100vw, 300px"></div></div><h2 class="woocommerce-loop-product__title">Saab 9-3 Aero V6 2.8 Turbo 280hk XWD -08</h2><div class="star-rating" title="Not yet rated"><span style="width:0%"><strong class="rating">0</strong> out of 5</span></div>
       	<span class="price"><span class="woocommerce-Price-amount amount">119,900<span class="woocommerce-Price-currencySymbol">kr</span></span></span>
       </a><a href="https://website.com/produkt/saab-9-3-aero-v6-2-8-turbo-280hk-xwd-08/" data-quantity="1" class="button product_type_blocket add_to_cart_button" data-product_id="3257" data-product_sku="blocket_83043361" aria-label="Läs mer om “Saab 9-3 Aero V6 2.8 Turbo 280hk XWD -08&rdquo;" rel="nofollow">Läs mer</a></li>
       ```
   
 * 3. This is fixed by going into the product, and resaving it without changing 
   anything else.
 * 4. The weird thing though is: If I do a database dump when it’s glitched, and
   compare it to a database dump after I’ve resaved it, there are 0 differences.
 * 5. My first thought was that it was some character/encoding issue somewhere which
   was fixed by the resave, but no, none, nada, nothing.
 * Any thoughts?
    -  This topic was modified 7 years, 4 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
    -  This topic was modified 7 years, 4 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
    -  This topic was modified 7 years, 4 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Trying to fix the AMAZINGLY broken formatting
    -  This topic was modified 7 years, 4 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).

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

 *  Plugin Support [John Coy a11n](https://wordpress.org/support/users/johndcoy/)
 * (@johndcoy)
 * Automattic Happiness Engineer
 * [7 years, 2 months ago](https://wordpress.org/support/topic/apparent-shortcode-bug/#post-11348118)
 * Hi [@lars00](https://wordpress.org/support/users/lars00/)
 * Try switching back to a default theme like Twenty Nineteen and disable all plugins
   except for WooCommerce to see if this resolves the issue. If so, then re-enable
   each one at a time until you find the one that’s causing the conflict.
 *  Thread Starter [lars00](https://wordpress.org/support/users/lars00/)
 * (@lars00)
 * [7 years ago](https://wordpress.org/support/topic/apparent-shortcode-bug/#post-11617136)
 * I just wanted to add that I solved it by hiding the wrong li with css. Nothing
   else helped, but that works so I’ll just let this be as is.

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

The topic ‘Apparent shortcode bug’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [lars00](https://wordpress.org/support/users/lars00/)
 * Last activity: [7 years ago](https://wordpress.org/support/topic/apparent-shortcode-bug/#post-11617136)
 * Status: resolved