Skip to content

Project Setup

This guide covers the initial project setup steps after cloning or copying the LamaPress boilerplate.

Table of Contents


Overview

After cloning or copying LamaPress, you need to set up dependencies, configure the environment, and build assets before starting development.

Initial Setup Steps

1. Install Dependencies

Install Node.js dependencies:

bash
npm install

This installs:

  • Vite and build tools
  • Tailwind CSS and plugins
  • JavaScript dependencies (GSAP, Swup, etc.)

2. Configure Environment

Set up your WordPress environment:

  1. Create .env file (if using environment variables)
  2. Configure wp-config.php with database credentials
  3. Set WordPress constants (if needed)

3. Set Up WordPress

  1. Create database for your WordPress installation
  2. Run WordPress installer or import existing database
  3. Activate theme in WordPress admin
  4. Install required plugins (ACF Pro, etc.)

4. Build Assets

Build assets for the first time:

bash
npm run build

Or start the development server:

bash
npm run dev

Project Configuration

Theme Information

Update theme information in style.css:

css
/*
Theme Name: Your Theme Name
Theme URI: https://your-site.com
Description: Your theme description
Author: Your Name
Author URI: https://your-site.com
Version: 1.0.0
*/

Post Types

Configure custom post types in config/post-types.php:

php
<?php

return [
    'your_post_type' => [
        'name' => 'Your Post Type',
        'singular_name' => 'Your Post Type',
        'menu_icon' => 'dashicons-admin-post',
        'template' => 'components/templates/your-template.php',
    ],
];

See Post Types & Taxonomies for details.

Taxonomies

Configure custom taxonomies in config/taxonomies.php:

php
<?php

return [
    'your_taxonomy' => [
        'post_types' => 'your_post_type',
        'name' => 'Your Taxonomy',
        'singular_name' => 'Your Taxonomy',
    ],
];

Configure menus in config/menus.php:

php
<?php

return [
    'primary' => 'Primary Navigation',
    'footer' => 'Footer Navigation',
];

First Steps

Create Your First Template

  1. Create components/templates/home.php:
php
<?php

/* Template name: Home */

defined('ABSPATH') || exit;

llStartTemplate();
llSection('hero_basic', 'home_hero');
llSection('rich_content', 'home_content');
llEndTemplate();
  1. Register in config/post-templates.php:
php
return [
    'page' => [
        'home.php' => 'Home',
    ],
];

See Templates System for details.

Create Your First Section

  1. Create components/sections/hero_basic/index.php
  2. Create components/sections/hero_basic/acf.php
  3. Use llSection('hero_basic', 'unique_key') in templates

See Component System for details.

Test the Build

  1. Start dev server: npm run dev
  2. Visit site in browser
  3. Check console for errors
  4. Test page transitions (if using Swup)
  5. Verify assets are loading

Best Practices

1. Version Control

Initialize Git (if not already):

bash
git init
git add .
git commit -m "Initial commit"

Important: Don't commit:

  • node_modules/
  • dist/ (build output)
  • .env files
  • WordPress core files

2. Environment Variables

Use environment variables for:

  • API keys
  • Database credentials (if needed)
  • Environment-specific settings

Store in .env and add to .gitignore.

3. Documentation

  • Update README.md with project-specific information
  • Document custom configurations
  • Add project-specific examples to docs

Next Steps:

Released under the MIT License.