Shortcodes should never be included in themes. Period.

Leland at ThemeLab offers a passionate argument that he does not believe any shortcodes should be included in WordPress themes. I think he makes plenty of good arguments, but I do think we should remember that all a shortcode does is provide a short-reference to a custom function callback. Therefore, you can literally put anything in a shortcode, but the shortcode methodology in WordPress simply makes that functionality available without digging into backend templates and code. So, I think Leland’s broad brush statement is a bit dangerous.

Similar Posts

One Comment

  1. Hey Brian, thanks for posting this here.

    You’re right, it was a blanket statement I used in the post headline. I should’ve probably made it more clear as to what types of WordPress themes I was referring to.

    If this is a custom theme, developed and supported by some sort of development shop, I think it’s fine. They can expect and handle any of the issues that might accompany including shortcodes functions directly in the theme.

    What I was mostly talking about in my post are publicly-released themes, which mainly use shortcodes for things like typography, layout, and other stylistic purposes.

    My main point was that these shortcode functions should be included in an accompanying plugin, so if the theme is switched, the shortcodes would remain intact.

Comments are closed.