144 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Europe
+1 more
WPEnter says

1. remove these – http://d.pr/i/eECn – This is a poor practice and we’re encouraging authors to use another methods rather than stripping out or modifying the_content() output as this may cause problems with third party plugins.

Can anyone help, is there any other way to escape p and br tags in shortcodes.

276 posts New Elite in Town!
  • Won a competition
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Won a Most Wanted contest
+6 more
icypixels says

That is indeed extremely poor practice and content locking your users with your shortcodes is indeed not desired on ThemeForest. Try using one of the open source page builders available like Aqua Page Builder in order to avoid the shortcode mess.

Paul

144 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Europe
+1 more
WPEnter says

I have finished my theme , i can not change the whole theme because of shortcode p and br tags. I will just delete that function.

144 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Europe
+1 more
WPEnter says

Can anyone who has approved WP theme, tell me how they resolve that problem… PLEASE…!!

280 posts
  • Has referred 10+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
PrimaThemes says

First, the message is very clear, do not use the_content filter to fix shortcode issue. Do not use it.

Second, in your code, you over-do it. Some of those shortcode do not need the fix. br and all single line shortcode do not need the fix.

You need to check closely what are your custom shortcodes that need this fix. Then you can simply fix it case by case, only for specific shortcode, before returning shortcode output.

144 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Europe
+1 more
WPEnter says

First, the message is very clear, do not use the_content filter to fix shortcode issue. Do not use it…
Thank you for your reply, but problem is not by adding p or br tags inside the shortcode, the problem is that if i add for example 2 shortcodes: [shortcode1] br or p tag [shortcode2]. As you can see the problem is by adding br or p tags betweet shortcodes and then it looks awful.
144 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Europe
+1 more
WPEnter says
Probably i can make it to looks as it needs, but then shortcodes will looks like this.
http://i.imgur.com/KqiFs6B.png

It is hard to modify and understand what shortcodes are added here, and there is another problem here is still p on the bottom of the page which i can not remove.
280 posts
  • Has referred 10+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
PrimaThemes says

Probably i can make it to looks as it needs, but then shortcodes will looks like this.
http://i.imgur.com/KqiFs6B.png

I say, WOW, that is not the purpose of shortcode. It is not readable, and give your user a killer “lock in” effect.

There are missing linebreaks for all shortcodes and it possibly creates unnecessary br and p tags on the output. This is not a good practice at the first place.

Basically you are okay to do it like that, but please make the content on WordPress WYSYWYG editor more readable and then you will only need to solve minimal issue, just like my suggestion above.

If my advice above is not okay for you, you still have some possible solutions.

1) Port your shortcodes to a plugin, your shortcode plugin, and use TGM to automatically install it when user activate your theme

2) Use third party shortcode / page builder plugin, for example Shortcode Ultimate, Visual Composer, etc

144 posts
  • Has sold $5,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Europe
+1 more
WPEnter says
I say, WOW, that is not the purpose of shortcode. It is not readable, and give your user a killer “lock in” effect….
Thank you for advices, i will try to minimize p and br tags if it’s possible, but if not i will definitely try to use some of these plugins.

Yes my shortcodes are in the plugin and i am using TGM to activate it.
1823 posts Don't Worry, Be Happy
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Located in United States
  • Made it to the Authors' Hall of Fame
+8 more
FinalDestiny says

Yes, I’m afraid there’s no official way to fix it, so your users will need to use the shortcodes on the same line in order to get the desired layout. That’s only if you use shortcodes. I did that in my themes where I’ve used shortcodes only and my buyers didn’t complain at all. Or you could integrate them with the WP editor and ask them to fill just the details… and the theme should automatically insert the shortcodes based on the content

by
by
by
by
by
by