136 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Italy
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
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.

1478 posts The right tools with none of the gimmicks
  • Sold between 50 000 and 100 000 dollars
  • Elite Author
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Bought between 10 and 49 items
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • United States
+1 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
  • Attended a Community Meetup
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Bought between 100 and 499 items
  • Contributed a Blog Post
  • Elite Author
  • Exclusive Author
+5 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
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
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
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 50 and 99 users
  • Sold between 50 000 and 100 000 dollars
  • United States
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.

3424 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Community Moderator
  • Bought between 100 and 499 items
  • Referred more than 2000 users
  • United States
  • Has been a member for 4-5 years
+5 more
sevenspark Volunteer 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. :)

1028 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 500 and 999 users
+1 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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Italy
  • Referred between 1 and 9 users
  • Sold between 1 000 and 5 000 dollars
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.

469 posts
  • Author had a File in an Envato Bundle
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Contributed a Tutorial to a Tuts+ Site
  • Exclusive Author
  • Has been a member for 4-5 years
  • India
+1 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..
1028 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 500 and 999 users
+1 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 .

by
by
by
by
by
by