0

I asked a question similar to this, but after reading a comment from another question which states the functions.php file should not be used for plugin related stuff, I thought I would ask a slightly different question.

Currently I have a number of complex CPTs set up as plugins which in places share similar functionality. I re-factored the code in question and added the code fragments as individual functions within functions.php.

Should these plugin related functions be moved out of funtions.php as they are not directly theme related? If so, where? I was thinking of moving the functions to a yet another separate settings plugin I have made (which holds misc settings for each CPT not available in its respective plugin).

I realise I may have not taken the correct approach, but I am curious for future development.

1

If you want the theme to be independent from the CPT's, place the CPT's as plugin(s). If the CPTs go with the theme, functions.php sounds like the perfect spot for them.

If you add them as plugins, you should group them in one or more plugins depending on functionality, not on post type.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.