When coding a WordPress theme, where does the theme (i.e. the presentation) end and the plugin (i.e. the functionality) begin?

The best guideline I have seen for what should be in a theme is to put “functionality” in a plugin.

I am looking at adding more “premium features” like jQuery image sliders. This requires a back-end user interface for selecting featured content to slide. Is this presentation?

Read More

How about shortcodes? A shortcode is a simple hook that enables you to call a PHP function by adding something such as [shortcode] to a post or page. I see this in themes all the time. Is it presentation?

I am unable to sort it out!

Related posts

Leave a Reply

1 comment

  1. I would say that one line would be presention versus creation of content.

    It is one thing to have a slider that displays certain posts; it is another entirely to have a new post type for the slider. A slider can be set to display content based on existing taxonomies, or existing post meta (such as sticky posts), which would merely be presentation of content. Asking the user to upload slider images to a custom post type would be creation of content.

    A shortcode that gets added to the post content is, IMHO, always Plugin territory. In terms of presentation versus creation of content, a post-content shortcode represents creation of content. Consider what happens when the Theme is switched: suddenly the parsed shortcode content is replaced with an ugly shortcode.

    Another line is site functionality. In almost all cases, site functionality – which almost always is agnostic toward the presentation of content – is Plugin territory. This would include things like removing the WordPress version meta tag, or adding Google Analytics.