Title: Shortcode breaks css
Last modified: August 21, 2016

---

# Shortcode breaks css

 *  [thiloroe](https://wordpress.org/support/users/thiloroe/)
 * (@thiloroe)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/)
 * Hi Paul,
 * sorry to bug you with this but I’m really mystified. Everything worked fine but
   now suddenly the customized button of your plugin breaks my css. No idea why.
   Maybe since upgrading to WP 3.8? I don’t know.
 * Here’s a link to a page without the button and proper styling:
    [http://allesbeste.de/audio-und-hifi/der-beste-mobile-bluetooth-lautsprecher](http://allesbeste.de/audio-und-hifi/der-beste-mobile-bluetooth-lautsprecher)
 * Here’s a link to an otherwise identical page but with the shortcode for the button
   at the end of the article and at the top of the sidebar:
    [http://allesbeste.de/audio-und-hifi/der-beste-wlan-lautsprecher](http://allesbeste.de/audio-und-hifi/der-beste-wlan-lautsprecher)
 * The problem persists even if I remove all the css for the button. And what’s 
   weirder still: I didn’t change anything except upgrading to WP 3.8.
 * Any ideas what’s going on?
 * Thanks in advance,
 * Thilo.
 * [http://wordpress.org/plugins/amazon-link/](http://wordpress.org/plugins/amazon-link/)

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/shortcode-breaks-css/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/shortcode-breaks-css/page/2/?output_format=md)

 *  Thread Starter [thiloroe](https://wordpress.org/support/users/thiloroe/)
 * (@thiloroe)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430534)
 * Problem solved.
 * I don’t really know what was going on. There was a # in the code that shouldn’t
   have been there. Maybe that caused the problem.
 * The shortcode name was also starting with a space to have it at the top of the
   list…
 * Changed both and now it seems to be working fine again. Very weird.
 * There also might be an issue with the new WP admin css: the custom templates 
   didn’t show properly in Chrome in your template settings.
 * So, I’m still a bit mystified, but everythings working again so I better not 
   touch anything anymore…
 * Best,
    Thilo.
 *  Plugin Author [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * (@paulstuttard)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430597)
 * Hi,
 * Glad you got it sorted, looking at your template again looks like the initial
   div is malformed, should it not be:
 *     ```
       %LINK_OPEN%de#<div>%LINK_OPEN%de# <div class="CTAButton"><i class="fa fa-shopping-cart" style="padding-right:10px"></i>Bei Amazon %PRICE%DE#</div>%LINK_CLOSE%</div>%LINK_CLOSE%
       ```
   
 * NOT:
 *     ```
       %LINK_OPEN%de#<div %LINK_OPEN%de# <div class="CTAButton"><i class="fa fa-shopping-cart" style="padding-right:10px"></i>Bei Amazon %PRICE%DE#</div>%LINK_CLOSE%</div>%LINK_CLOSE%
       ```
   
 * Changing the `<div` to `<div>`
 * Paul
 *  Thread Starter [thiloroe](https://wordpress.org/support/users/thiloroe/)
 * (@thiloroe)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430616)
 * Yes, obviously, thank you!
 * Now it also works without the strange nesting:
 *     ```
       <div> %LINK_OPEN%
       <div class="CTAButton">
       <i class="fa fa-shopping-cart" style="padding-right:10px"></i>
       Bei Amazon %PRICE%
       </div>
       %LINK_CLOSE%</div>
       ```
   
 * Thilo.
 *  Thread Starter [thiloroe](https://wordpress.org/support/users/thiloroe/)
 * (@thiloroe)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430841)
 * Hi Paul,
 * something is still wrong. Now some pages don’t load properly. This one, for instance:
   
   [http://allesbeste.de/drucker/der-beste-multifunktionsdrucker](http://allesbeste.de/drucker/der-beste-multifunktionsdrucker)
 * Another works although it’s actually the same:
    [http://allesbeste.de/drucker/der-beste-laserdrucker-fuer-zuhause](http://allesbeste.de/drucker/der-beste-laserdrucker-fuer-zuhause)
 * All pages load properly, when I disable the Amazon Link plugin.
 * Any ideas?
 * t.lo
 *  Thread Starter [thiloroe](https://wordpress.org/support/users/thiloroe/)
 * (@thiloroe)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430843)
 * If I remove the shortcodes from pages, they load fine.
 * Very weird.
 * t.lo
 *  Thread Starter [thiloroe](https://wordpress.org/support/users/thiloroe/)
 * (@thiloroe)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430844)
 * If I simply remove %LINK_OPEN% from the template, everything works fine. So calling
   the link seems to cause the problem.
 * Could this be a problem with yesterday’s update?
 * Best,
 * Thilo.
 *  Thread Starter [thiloroe](https://wordpress.org/support/users/thiloroe/)
 * (@thiloroe)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430847)
 * It gets weirder still: most pages load if I disable the product cache. Enabling
   the cache and ticking the prefix data box makes most pages refuse to load.
 * With the cache disabled, pages sometimes load, sometimes not. At least with re-
   loading a couple of times, I can make the page appear. Especially with this link:
 * [http://allesbeste.de/drucker/der-beste-multifunktionsdrucker](http://allesbeste.de/drucker/der-beste-multifunktionsdrucker)
 * (BTW: the MacBook Air page doesn’t have a shortcode to your plugin and works 
   consistently: [http://allesbeste.de/laptops/das-beste-laptop](http://allesbeste.de/laptops/das-beste-laptop))
 * So it seems there’s something wrong with the plugin, not with my template code…
 * Thilo.
 *  Plugin Author [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * (@paulstuttard)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430851)
 * Hmmm,
 * Thanks for looking into it, does reverting to the previous version of the plugin
   fix things?
 * Not sure I’ll get much time to look into it in the next couple of weeks, but 
   I’ll double check the recent changes.
 * Paul
 *  Thread Starter [thiloroe](https://wordpress.org/support/users/thiloroe/)
 * (@thiloroe)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430857)
 * No, the problem persists with the old version, too. Very weird.
    What’s strange
   is that it’s not consistent. Sometimes one page loads, sometimes another one.
 * Thilo.
 *  Plugin Author [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * (@paulstuttard)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430862)
 * Do you have access to the php error log?
 * This might give us a clue to what is going wrong, I’m guessing that either the
   AWS lookup is occasionally failing or bringing back partial data. This is being
   saved in the cache and causing the plugin to fail.
 * Intermittent problems can be due to running low on memory? Could try raising 
   the maximum?
 * Paul
 *  Thread Starter [thiloroe](https://wordpress.org/support/users/thiloroe/)
 * (@thiloroe)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430882)
 * I don’t seem to be getting any php errors. I turned error logging on, but nothing
   so far.
 * I can’t imagine there being a memory problem as I only have very few pageviews.
   Being on shared hosting I can’t really change anything there anyway.
 * Played around a bit with the settings though and found out that the problem seems
   to occur especially when the Shortcode Cache is disabled – regardless if product
   cache and/or Prefetch Data is on. Though I also got some blank pages with prefetching
   on. It’s really strange.
 * At the moment it works again with prefetching and both product and shortcode 
   cache enabled. I had product cache and prefetching on before the problem occurred,
   but not the SC cache. I think.
 * I’ll let you know, if anything changes.
 * Thilo.
 *  Thread Starter [thiloroe](https://wordpress.org/support/users/thiloroe/)
 * (@thiloroe)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430884)
 * Sorry to report that the problem is back, this time with a twist: I have two 
   buttons triggered by the exact same shortcode on a product page. The one in the
   sidebar works fine, the one on the bottom of the article produces a wrong link.
   See here:
    [http://allesbeste.de/tablets-und-e-reader/das-beste-tablet](http://allesbeste.de/tablets-und-e-reader/das-beste-tablet)
 * This is the corrupt link from the bottom button:
    [http://www.amazon.%25tld%DE/#/gp/product/B00G50IFDI?ie=UTF8&linkCode=as2&camp=1634&creative=6738&tag=%25TAG%DE%23&creativeASIN=B00G50IFDI](http://www.amazon.%25tld%DE/#/gp/product/B00G50IFDI?ie=UTF8&linkCode=as2&camp=1634&creative=6738&tag=%25TAG%DE%23&creativeASIN=B00G50IFDI)
 * I flushed the shortcode and product link. The result was again lots of blank 
   pages. Got it back to work with switching caches back on one after another, this
   time without prefetching. No consistent behaviour there. The link in the bottom
   button is still corrupt though. And I still see nothing in the php error log.
 * Something is very wrong…
 * Thilo.
 *  Thread Starter [thiloroe](https://wordpress.org/support/users/thiloroe/)
 * (@thiloroe)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430890)
 * Hi Paul,
 * I uninstalled the plugin completely and reinstalled it. I still get blank pages
   when SC cache is not enabled. If SC cache is enabled, most of the links are corrupted(
   see above).
 * I can also confirm that the plugin does not produce ans php errors. The error
   log is working properly but there are no errors from your plugin.
 * Seems like I’ll have to look for another solution.
 * Thilo.
 *  Plugin Author [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * (@paulstuttard)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430891)
 * Hmm,
 * Is it any more reliable if you do not have to extra plugin to scrape the ‘latest’
   price off the Amazon web site?
 * Am I right in thinking you only have 2 Amazon Link shortcodes on each page, and
   they are both the same shortcode, using the template above?
 * Paul
 *  Thread Starter [thiloroe](https://wordpress.org/support/users/thiloroe/)
 * (@thiloroe)
 * [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/#post-4430892)
 * Yes, I have two buttons using the exact same shortcode. The one in the sidebar
   always works, the one at the bottom of the post often – but not always – has 
   a corrupted link with [http://www.amazon.%25tld%DE&#8230](http://www.amazon.%25tld%DE&#8230);
 * If I turn off the plugin or remove the shortcodes, the site works 100% correct.
 * At the moment, all pages load again. I have shortcode cache on, but product cache
   and prefetch off. With shortcode cache off, most post pages just show a blank
   page.
 * Thilo.

Viewing 15 replies - 1 through 15 (of 16 total)

1 [2](https://wordpress.org/support/topic/shortcode-breaks-css/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/shortcode-breaks-css/page/2/?output_format=md)

The topic ‘Shortcode breaks css’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/amazon-link_070606.svg)
 * [Amazon Link](https://wordpress.org/plugins/amazon-link/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amazon-link/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amazon-link/)
 * [Active Topics](https://wordpress.org/support/plugin/amazon-link/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amazon-link/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amazon-link/reviews/)

 * 16 replies
 * 2 participants
 * Last reply from: [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * Last activity: [12 years, 5 months ago](https://wordpress.org/support/topic/shortcode-breaks-css/page/2/#post-4430903)
 * Status: not resolved