136 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
Raspo says

I see that a lot of wordpress themes are using shortcodes to display blockquote, column, buttons, lists etc. This is a great solution for displaying complex html structure inside a post, but it’s like inserting inline style instead of using the css, if you know what I mean.

For example, last week I was hired from a TF user that was switching from the inFocus theme to Catapult and guess what? I had to replace every shortcode in each post in order to make them work properly in the new theme. I can of course use some tools to make a “find and replace” but that’s not the point.

I think that using shortcodes is not that smart or at least flexible, and they should not be overused.

I wonder what you guys think about it.

1479 posts The right tools with none of the gimmicks
  • Has referred 50+ members
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+6 more
PixelBin says

Always hated the idea of them. I don’t see how [btn color=”red”]Go to Portfolio[/btn] is easier than <a class="red">Go to Portfolio</a>.

Pure laziness. :tired:

2952 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 200+ members
  • Has sold $125,000+ on Envato Market
  • Had an item featured in an Envato Bundle
+10 more
DDStudios says

I don’t want to make self promotion but I think theres a good way to make shortcode easy for the user even if its “complex” code snippet like slider, tab content, toggle content etc and its by adding a panel for them to create these shortcode by just entering their information like we did for the last theme, take a look at my new synergie theme.

Also, they dont have to memorize the shortcodes or go and see in their documentation every time,

I agree that for simple button, its useless but I think that for more complex situation, its pretty neat.

What do you guys think?

397 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
  • Has sold $40,000+ on Envato Market
  • Sells items exclusively on Envato Market
+2 more
Monkify says
Always hated the idea of them. I don’t see how [btn color=”red”]Go to Portfolio[/btn] is easier than <a class="red">Go to Portfolio</a>. Pure laziness. :tired:

There won’t be much assistance with something like a button, it’s when you get into more complex things that it becomes useful.

206 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 50+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 50+ items on Envato Market
+2 more
mlando says
For example, last week I was hired from a TF user that was switching from the inFocus theme to Catapult and guess what? I had to replace every shortcode in each post in order to make them work properly in the new theme.

I think this is the biggest downside… changing to a new theme that is. Codes that work in one will not work in another so you will have to go back and take them out everywhere you used them. Something that should at least be considered when using them. They are very slick for larger code blocks and if you plan on sticking with the theme for a while … just be sure to consider the pros and cons.

3503 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $750,000+ on Envato Market
  • Located in United States
  • Helps us moderate the forums
+10 more
sevenspark Moderator says

Like Monkify said, it’s definitely the more complicated HTML structures that shortcodes help to simplify, like portfolios or sliders.

I do hear what you’re saying about the similarity to inline styling and its pitfalls. One way to fix this without doing a Find and Replace is to just add a new shortcode->function mapping. For example, if the old shortcode is called “col4” and the shortcode in the new theme is called “col-1-4”, you just need to add a new mapping from “col4” to the new col_1_4 function. i.e.

add_shortcode('col4', 'col_1_4'); //maps the old shortcode to the new function

In more complicated cases, where different parameters/attributes are used (like ‘width= 100”’ vs ‘w=”100”’, for example), you could write a sort of adapter function for the offending shortcodes and map the old shortcode to the adapter. If your old shortcode is portfolio and the new one is folio, you could do something like this:

function folio($atts, $data){
  //this is the function in the new theme, linked to the [folio] shortcode
}

function portfolio_to_folio_adapter($atts, $data){
  //take the data from the old shortcode and transform for the new shortcode. 
  //adapt old attributes to new attribute names
  ...
  //then call the new shortcode function with the transformed/adapted data
  folio($adapted_atts, $adapted_data);
}

// maps the old shortcode to the adapter for processing by the new shortcode function
add_shortcode('portfolio', 'portfolio_to_folio_adapter'); 

Depending on the case, that might work better than updating every post. :)

1029 posts
  • Has referred 500+ 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
+6 more
ThemeBlvd says

I think to a lot of buyers the really simple shortcodes (like your guys’ button example) are still necessary, because a lot of people don’t feel comfortable going into the HTML mode when they’re editing a page or post. Something like a simple button shortcode they can write while they’re in the Visual editing mode.

Also, I don’t see why adding more shortcodes is a bad thing. You always have the choice not use them.

136 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $1,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
Raspo says
...a lot of people don’t feel comfortable going into the HTML mode when they’re editing a page or post. Something like a simple button shortcode they can write while they’re in the Visual editing mode.
I think you have a point here. Shortcodes can be added directly into Visual Mode.

Anyway, using shortcodes this much is not flexible at all. Maybe, if we were using some sort of “standard” (example, in any themeforest theme, a blockqoute is called with [quote], a button is [button link=#], etc ), changing theme would not be so painful.

470 posts
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
SaurabhSharma says
Something like a simple button shortcode they can write while they’re in the Visual editing mode.
Sometimes VISUAL mode becomes a pain for using short-codes. And we end up disabling wpautop and wptexturize filter. I am always troubled by this situation. If I provide a lot of short-codes, WP will add p and br. If I don’t, people have to use HTML . What to do..
1029 posts
  • Has referred 500+ 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
+6 more
ThemeBlvd says
Something like a simple button shortcode they can write while they’re in the Visual editing mode.
I am always troubled by this situation. If I provide a lot of short-codes, WP will add p and br. If I don’t, people have to use HTML . What to do..

The solution is simple. Add them. More is better. If they want to use HTML and not the shortcodes, they can. But MANY people that buy WordPress themes here on TF are not comfortable at all with HTML .

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by