Analyzing the code from WordPress themes, both free and paid for, and realized that there is no standard for the development of themes. Some themes use CPT for all other widgets, other Visual Composer (and dirty code) and so on.

I know WordPress, studying hard and already making my themes and I am honestly confused as to which way I should build my themes. What is the best or "worst" method.

Some may say that "the best method is what solves your problem," but I believe it is not because it solves my problem, which is the best method. Not because it is running that is good!

My question is, is there some way "more appropriate / better / less worse" to develop a theme? CPT, Widgets, VisualComposer and so on...?


The way you are asking your question doesn't follow WPSE guidelines. You will get a lot of opinionated answers which is not what we look for here.

Try to come up with more context with your question.

  • What are you building your theme for?
  • Who's your users (single client or public/masses)?
  • What problems are you trying to solve?
  • What tools are you considering to use to solve the issue?
  • Are you planning to build extensions/modules for your theme
  • Do you wish to separate some core functionalities from design or offer your client to modify design without affecting core functionalities (parent/child designs)
  • etc.

The worst method to build any program is to not be structured in your program logic and have functions all over the places (which would be a problem not specific to WP theme dev), repeating yourself, etc.

If you came up with a question like "I need to do so and so, is it better to use CPT or custom field to solve my issue" then it would be easier and more productive to answer that kind of question. We could then provide the pros and cons of either solutions.

There is all kind of situations, problems, clients, contexts that can affect the way you build your software. Sometimes, because it works it IS the better solution. But generally speaking you try to be as structured and concise as possible keeping your stuff readable/understandable for other devs and you (would you still understand your code if you came back to it, 6-12 months from now?)

| improve this answer | |

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