How to make my plugin theme-independent?

I need a little help and/or consulting for my next steps. (I’m a beginner!)

I’ve been working on my plugin, using a Custom Post Type “Project”, some help from the plugin “Advanced Custom Fields” – and now I have succeeded in the general functionality. Have a look at the images here and http://www.project22.org/project/ to see the functionality. I admit, there might be plugins doing something similar, but I’m not advanced enough yet to understand and adjust their code to my specific needs ;(.

I worked within a child theme of Twentytwelve and needed to work with some template files, e.g. I created single-project.php and project_loop.php to use with get_template_part().

Problem:

  • I’m not so happy with Twentytwelve anymore – I’d like to retain some flexibility in changing my themes.
  • Maybe one day I want to share my plugin with someone, who knows?

So now my aim is to move all parts of the functionality into a plugin …

Questions:

  • How can I display these little pieces of information related to various posts on any theme? I couldn’t find appropriate hooks nor filters.
  • How can I avoid creating theme template files, which might later screw up new themes?

I’m really confused, where I should use []-Shortcodes, create template files or snippets, where I can hook or filter into.

I appreciate any advice from you, thanks Flo

On the single-project.php the project's children are displayed in an extra loop.

On the single-project.php the project’s children are displayed in an extra

This post, shown in a loop, is child of a project. This is displayed as part of the entry meta information

This post, shown in a loop, is child of a project. This is displayed as part of the entry meta information

The project is displayed in a normal loop with all posts, so it gets a "Project:" prepended to the title.

The project is displayed in a normal loop with all posts, so it gets a “Project:” prepended to the title.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>