Starting WordPress Development

Hello,

I plan on starting WordPress theme development, but am in a small haze which I would be really grateful to get some help with. I’ve developed WordPress themes before for Themeforest helping another author, but that was 2 years back. Anything prior to Gutenberg, I’m familiar with. However, aside from that , anything else I should take into consideration? (I read this post https://help.author.envato.com/hc/en-us/articles/360020255992 - about Gutenberg requirements)

Is it preferable to write my theme in Object Oriented Programming (which i prefer) or just procedural style will cut it in TF?
What small notes can you guys help me with before I actually start developing WP themes?

Any small tip would help and be much appreciated.

Development isn’t gonna be your only problem. If you don’t have a good design to present theme, it doesn’t matter how perfect the coding is you would still get a rejection. Consider this part as well

Already got 2 HTML templates in, gonna try converting those to WP, with some minor interface tweaks here and there. Hence, me asking for community guidance on where to begin

It is totally up to you if you go with OOP or procedural style. I personally do mix of both. Just make sure your code is up to standards, easy to read and commented.

Do not forget to make the full advantage of WordPress filters (I mean both default ones and your custom ones too). Also try to avoid “spaghetti” code. Most of your HTML code should be put into template files and good template file should contain only basic PHP stuff like IFs, WHILEs, FOREACHs, filters, function calls and variables. Generally, the theme should be as easy to customize as possible.

1 Like

Sometimes it may be a bit difficult to write 100% OOP code in PHP :slight_smile: ( I speak now as a former Java developer with 20 years of experience… it was difficult for me to switch in 2013 - when I joined Envato Market - from full OOP in Java to PHP, which is mostly procedural).

If you start to write code for WordPress, I’d recommend to you to first find a very good, configurable IDE (I prefer Eclipse for PHP development, you can download it from here: https://www.eclipse.org/downloads/packages/release/2019-12/r/eclipse-ide-php-developers ). It has a lot of free plugins for almost everything…It’s highly configurable! But there are others IDEs too …

More important and very useful - no matter what IDE you use for development - is to use PHP Sniffer with a standard set of coding rules that will help you in the WordPress development (I wish I knew about them back in 2013 when I joined Envato Market :slight_smile: ).

Here you can find them on github: https://github.com/WordPress/WordPress-Coding-Standards/tree/master

They have a step-by-step guide on how to setup&use them in various IDEs. When you install them, you will see real time notifications regarding deprecated code, WordPress standards, errors and so on. It’s incredible how they can help you with the development! Good luck!

1 Like

A note : it doesn’t mean that WordPress will approved even your HTML templates approved already.

1 Like

Thank you so much for this great information, will most definitely take a look at the PHP Sniffer you talked about!