Theme description
- repository:
[email protected]:jmucak/wp-theme-template.git
- figma: ``
- PHP > 8.1
- composer v2
- node v20
- npm v10
- Clone this repository in
/wp-content/themes
folder git clone [email protected]:jmucak/wp-theme-template.git your-project-folder
- Push to a new repository
git remote set-url origin {your git repository}
git push origin main
- Run
composer install
- Run
nvm use
andnpm i
to use and install required packages - Run
npm run build
to create assets build folder - Activate the theme through the 'Themes' screen in WordPress
npm run dev
: watches and compiles files on changenpm run build
: creates production ready versions of css and js insidestatic
folder
- write clean and OOP code
- every class, functions or any logic should exists only in
app
folder
- WordPress coding standards github and docs should be applied
- exception of naming classes because of autoloader, classes should be named with CamelCase
- No shorthand PHP Tags => use
<?php ... ?>
- Single and Double Quotes => If you’re not evaluating anything in the string, use single quotes
- Methods and Functions should be named with snake_case, Example:
get_posts(), get_data()
- Brace Style => Braces should always be used in all code blocks, Example:
if($some_condition) { // Do something}
- When declaring a function or a class braces are added at the end of the line, not in the new line
- Declaring Arrays => Arrays must be declared using long array syntax, Example:
array(1,2,3);
- Using import use statements => Import
use
statements should be at the top of the file and follow thenamespaces
declaration