Skip to content

Overview

In this chapter, we’ll explore how our team works within the WordPress ecosystem. The goal is to give you an understanding of our particular approach, from the tools we use to the way we organize our codebase.

We begin by developing our own custom WordPress theme. This theme usually starts from a shared starter template that we adjust to each project’s needs. On the frontend, we rely on bundlers like Webpack or Vite to handle asset management, optimize performance, and streamline our development workflow.

For backend operations, we use PHP classes as blueprints. These classes help maintain clean, modular code and standardize how we implement features or data manipulation within WordPress. We also leverage well-known plugins, such as Advanced Custom Fields (ACF) for flexible content management, Yoast for SEO optimization, and All in One for additional site tools.

Finally, when it’s time to launch a project, we use Gulp to automate our deployment process. Gulp manages tasks like minifying files, optimizing images, and preparing all assets so the final product runs smoothly on production servers.

By the end of this chapter, you should have a clear picture of how we build, structure, and deploy WordPress projects in a way that keeps our workflow organized, efficient, and scalable.

This is how tipically a wordpress theme looks like, you can see more @ Terra Starter kit

πŸ“¦ {client-acronim}-wp-theme/
β”œβ”€β”€ πŸ“¦ components/ // All PHP components live here (e.g. buttons, cards)
β”œβ”€β”€ πŸ“¦ config/ // Config files (SFTP deploy, Vite settings)
β”œβ”€β”€ πŸ“¦ documentation/ // Project docs: checklist, performance tips, etc.
β”œβ”€β”€ πŸ“¦ flexible/ // Hero sections and modules used on the site
β”œβ”€β”€ πŸ“¦ functions/
β”‚ β”œβ”€β”€ default/ // Terra's default framework (reusable functions)
β”‚ └── project/ // Custom functions for this specific project
β”œβ”€β”€ πŸ“¦ public/ // Files publicly accessible (e.g. favicon, robots.txt)
β”œβ”€β”€ πŸ“¦ src/
β”‚ β”œβ”€β”€ πŸ“¦ js/ // JavaScript code
β”‚ └── πŸ“¦ scss/ // SCSS stylesheets
β”œβ”€β”€ .env.local // Local environment variables
β”œβ”€β”€ .env.production // Production environment variables
β”œβ”€β”€ .env.virtual // Virtual/staging environment variables
β”œβ”€β”€ .gitignore // Files and folders Git should ignore
β”œβ”€β”€ 404.php // Custom 404 error page
β”œβ”€β”€ footer.php // Global footer template
β”œβ”€β”€ functions.php // Loads theme features and functions
β”œβ”€β”€ gulpfile.js // Used for deploying the site
β”œβ”€β”€ header.php // Global header template
β”œβ”€β”€ package.json // Project dependencies and scripts
β”œβ”€β”€ index.php // Main entry point for WordPress
β”œβ”€β”€ style.scss // Main global SCSS file
└── vite.config.js // Vite build tool config