WP Theme Forward Compatibility - Shortcodes/CPTs


#1

This may have been a topic here before, but I can’t seem to find any “solution” posts. What measures are theme authors taking to ensure all is not lost when the user changes themes a year down the road? Is including a plugin to handle shortcodes and custom post types a bad idea? To me, that seems to be the only way these functions will remain useful.

Or, are authors viewing things as a “by changing themes, they have made a decision to drop those functions” kinda thing? It would be great to not set a user up for a huge headache down the road.

I apologize if this topic has been beaten to death already. Thanks for your input.


#2

Any theme author who is adding these things to their themes is flat out doing it wrong. They belong in a plugin. You can package that plugin with the theme or release it separately, such as on WordPress.org.


#3
greenshady said

Any theme author who is adding these things to their themes is flat out doing it wrong. They belong in a plugin. You can package that plugin with the theme or release it separately, such as on WordPress.org.

Just curious that doing this would let every author to release their own plugins which do the same task of generating shortcodes?

Or do you mean using the third-party plugin in this case?


#4

It would depend on the actual case. Nothing specific was asked.

In general, I’d argue for getting behind and supporting specific plugins. The two major reasons for this are standardization and portability. Some examples: WooCommerce, bbPress, BuddyPress, etc. If the wheel’s already been invented, use it.

I’ll be more than happy to build or contribute to some open-source plugins to handle various use cases in this area if a plugin doesn’t already exist.


#5
greenshady said

Any theme author who is adding these things to their themes is flat out doing it wrong. They belong in a plugin. You can package that plugin with the theme or release it separately, such as on WordPress.org.

Is it bad practice to package a plugin with a theme? I mean, do reviewers care about this problem and see it as a good thing or will they see it as a negative that the user has to install a plugin? Also, if an author is packaging shortcodes and custom post types, all JS and CSS would also need to be included with the plugin right? It seems like this could get a lot deeper than just shortcodes and CPTs.

Are any authors packaging shortcodes and CPTs in plugins now?


#6

I like the idea of an open-source plugin to handle various cases. It seems like the ethical thing to do, rather than leave users stranded.


#7
Is it bad practice to package a plugin with a theme?

TF seems to have a lot more “noob” WP users, so it might not be a bad idea to package it with (definitely not in) the theme. In general, I’d say to just write a note in the documentation to install the plugin if the user wants the functionality.

Keep in mind that a theme should never rely on that plugin functionality either. The theme should stand on its own, whether the plugin is installed or not.

I mean, do reviewers care about this problem and see it as a good thing or will they see it as a negative that the user has to install a plugin?

No idea. But, if I were a reviewer, I’d reject any theme immediately that registered a CPT or a shortcode for use in post content.

Also, if an author is packaging shortcodes and custom post types, all JS and CSS would also need to be included with the plugin right?

It would depend on the specific scenario. A good rule of thumb: Plugins add functionality and themes present content. Keep that in mind and you should be okay.

It seems like this could get a lot deeper than just shortcodes and CPTs.

Yes, there’s a lot more than just shortcodes and CPTs. These are just the obvious examples. There are some things that are even pretty borderline theme/plugin, but these two are clearly plugin territory.

Are any authors packaging shortcodes and CPTs in plugins now?

I have one of the oldest and longest-running WordPress theme/plugin clubs still around. If I need to add something like a shortcode or CPT, it goes into a plugin. Not once in several years have I had a user who couldn’t figure it out.


#8

Thanks. This thread clears it up for me.


#9

Sad part is that so many authors included them in the theme, that buyers here are actually expecting the theme shortcodes and CPTs to work as soon as the theme is installed. “It works in the demo, why the hell is my site broken when I install your theme?!” doesn’t look too good for sales… so authors keep including them.

This leads to people reading documentation less and less and will now be a pain in neck for any ‘good guy Greg’ out there that wants to do it right, as greenshady mentioned above. (read: “support nightmare and many low ratings due to wrong first impression”)

All I can say is that I lost hours of development while creating a child theme for a customer, simply because the previous theme used was heavily relying on shortcodes (which were obviously not present in the new theme)…


#10
digitalimpact said

All I can say is that I lost hours of development while creating a child theme for a customer, simply because the previous theme used was heavily relying on shortcodes (which were obviously not present in the new theme)…

I’ve been there, which is exactly why I was concerned about this for my own themes. Maybe an admin notice stating that the plugin must be activated for added features, as well as a reference to the documentation page would reduce some of the support issues/ratings issues.


#11
imikedesigns said

I’ve been there, which is exactly why I was concerned about this for my own themes. Maybe an admin notice stating that the plugin must be activated for added features, as well as a reference to the documentation page would reduce some of the support issues/ratings issues.

This is a handy script for handling plugins on theme activation. https://github.com/thomasgriffin/TGM-Plugin-Activation


#12

Shortcodes in themes sold here are tightly bound with the theme itself. Having them in a separate plugin to be used with another theme is never going work. Quick example: how a tab (or column) shortcode using twitter bootstrap is supposed to work in a theme not using it ?

And who’s going to handle support for such situations ? neither author of new theme or author of old one will be able to so the buyer will be left alone to solve the issue. When he realize he can not, who’s going to blame in comments/ratings ?

BF


#13
Frenkz said

This is a handy script for handling plugins on theme activation. https://github.com/thomasgriffin/TGM-Plugin-Activation

Thanks. Looks like a very handy script.

@pixelentity
That’s a good point. So what to do? Add these things to the theme and forget about it? Its a tough issue.


#14
Sad part is that so many authors included them in the theme, that buyers here are actually expecting the theme shortcodes and CPTs to work as soon as the theme is installed. “It works in the demo, why the hell is my site broken when I install your theme?!” doesn’t look too good for sales… so authors keep including them.

This isn’t a user problem though. It’s a developer one. More specifically, it’s a TF developer problem. You rarely see this type of issue in the larger WP theme developer community, and the few lingering issues are being worked out by the development community.

Too many developers here on TF are thinking about the bottom line rather than what’s best for their users. When you add functionality that literally holds the key to a user’s content within a theme, you’re locking them into using your theme and your theme only, at least until the user hires another developer to fix your crap.

Not only is this bad development practice, it’s an unethical business tactic.

Shortcodes in themes sold here are tightly bound with the theme itself. Having them in a separate plugin to be used with another theme is never going work.

This is exactly why there’s such a problem on TF with these things. Rather than saying you can’t do something, you should be asking, “What solutions can we come up with?” and working to fix the problem.

A developer’s job is to come up with solutions for problems.

Quick example: how a tab (or column) shortcode using twitter bootstrap is supposed to work in a theme not using it ?

Any 13-year-old WP developer with Bootstrap knowledge could write this plugin in about two hours. Any more examples?

And who’s going to handle support for such situations ?

Be more specific. Each scenario has a different solution.


#15

Why would I, as a developer, use shortcodes or plugins from another developer or some 3rd party plugins, in order to make them compatible with all the themes?

There is no point in doing that and that would cause lots of questions like “What? Why do I need all this kind of plugins to use your theme?” or bug reports related to the shortcodes and functionality you didn’t write. That’s never going to work, it’s like having all the features a BMW car has, in a Renault car, just because they’re both cars. That’s never going to happen.


#16
Why would I, as a developer, use shortcodes or plugins from another developer or some 3rd party plugins, in order to make them compatible with all the themes?

Because you care about the people using your products.

If you’re really worried about someone else’s code, write your own plugin(s). This isn’t about 3rd-party vs. in-house code. It’s about good vs. bad development practice.

There is no point in doing that and that would cause lots of questions like “What? Why do I need all this kind of plugins to use your theme?” or bug reports related to the shortcodes and functionality you didn’t write.

Nevermind that the larger WP developer community has been handling this well for years.

That’s never going to work, it’s like having all the features a BMW car has, in a Renault car, just because they’re both cars. That’s never going to happen.

I’m not even sure how to respond to that. That is not even close to accurate analogy of the topic at hand.


#17

Interesting discussion.

I would agree that such functionality belong’s to plugin for sake of portability, but I don’t see it happening very soon, existing authors will hardly leave the routine they have now.


#18
greenshady said

Any 13-year-old WP developer with Bootstrap knowledge could write this plugin in about two hours. Any more examples?

No point in doing that when any 13-year-old WP developer could solve the issue in no time.

BF


#19

Some buyers don’t know how to correctly install the theme and you expect them to download and install different plugins in order to make the theme work? No way. It is an extremely BAD development practice to make your themes depend on 3rd party plugins.


#20

Not at all. Your theme should work without any plugins.