496 posts
  • Has referred 1000+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+8 more
pixelentity says
1659 posts Building the Web.
  • Has been a beta tester for an Envato feature
  • Sells items exclusively on Envato Market
  • Has sold $250,000+ on Envato Market
  • Had an item featured on Envato Market
+7 more
ZoomIt says
http://wpforce.com/prevent-wpautop-filter-shortcode/

“ThemeForest theme developers in particular seem to love adding this code to their themes.” – lol

2196 posts
  • Has referred 200+ members
  • Has sold $500,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+13 more
mpc says

Thanks guys I have fixed it on my own ;P But for the next theme I will probably use the provided snippet.

1659 posts Building the Web.
  • Has been a beta tester for an Envato feature
  • Sells items exclusively on Envato Market
  • Has sold $250,000+ on Envato Market
  • Had an item featured on Envato Market
+7 more
ZoomIt says

Would be nice to provide the fix since you started the thread and others may be intersted :d

149 posts
  • Has been part of the Envato Community for over 3 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+1 more
IulianN says

Would be nice to provide the fix since you started the thread and others may be intersted :d

+1 for this and up we go :)

778 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $250,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Made it to the Authors' Hall of Fame
+6 more
LCweb says

I had a very strange issue with empty paragraphs and spaces in the the shortcode of my last plugin.
I tried a lot of solution posted by authors here in the past months, but the only thing that solved it was this piece of code:

$data = shortcode content ..
$data= str_replace(array("\r", "\n", "\t", "\v"), '', $data);
return $data;

I don’t know if is the best way, but it works :D

312 posts
  • Has referred 10+ members
  • Provided great contribution to our forums
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+5 more
cosmincotor says

I’m also looking for a bulletproof solution, so if anyone has it, please share it with us :)

731 posts
  • Has referred 500+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+7 more
mordauk says

Bulletproof solution: do not any of this. This kind of behavior should only ever be done in plugins.

These kind of snippets literally cause me and many other plugin developers dozens or hundreds of hours in support requests.

778 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $250,000+ on Envato Market
  • Sells items exclusively on Envato Market
  • Made it to the Authors' Hall of Fame
+6 more
LCweb says

Bulletproof solution: do not any of this. This kind of behavior should only ever be done in plugins. These kind of snippets literally cause me and many other plugin developers dozens or hundreds of hours in support requests.

Indeed. Probably my issue was caused by one of them, since on the Twenty Eleven theme everything was fine.

312 posts
  • Has referred 10+ members
  • Provided great contribution to our forums
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+5 more
cosmincotor says

Bulletproof solution: do not any of this. This kind of behavior should only ever be done in plugins. These kind of snippets literally cause me and many other plugin developers dozens or hundreds of hours in support requests.

It’s true, in most cases these snippets can cause major problems, however without removing those empty p tags the shortcodes won’t work properly, because WordPress adds them all over the place.

So, again, has anyone found a proper way to create shortcodes in a theme, without the use of a plugin, and without affecting other plugins ?

by
by
by
by
by
by