Skip to content

giuseppe-trisciuoglio/developer-kit / plugins/developer-kit-php/skills/wordpress/wordpress-sage-theme

wordpress-sage-theme

Verified

Provides WordPress theme development patterns using Sage (roots/sage) framework. Use when creating, modifying, or debugging WordPress themes with Sage, including (1): creating new Sage themes from scratch, (2): setting up Blade templates and components, (3): configuring build tools (Vite, Bud), (4): working with WordPress theme templates and hierarchy, (5): implementing ACF fields integration, (6): theme customization and asset management.

FileKindSize
SKILL.mdskill md12.6 KB
assets/starter-layout.blade.phpscript549 B
assets/starter-page.blade.phpscript1.6 KB
references/acf.mdmarkdown9.5 KB
references/blade.mdmarkdown5.1 KB
references/bud.mdmarkdown5.0 KB
references/sage.mdmarkdown2.4 KB

references/sage.md

View on GitHub
# Sage Framework Reference

Complete reference for the Sage WordPress theme framework.

## Installation Methods

### Method 1: WP CLI

```bash
wp scaffold sage-theme my-theme --theme_name="My Theme" --author="Name" --activate
```

### Method 2: Composer

```bash
composer create-project roots/sage my-theme
cd my-theme
composer install
```

## Theme Structure

```
theme/
├── app/
│   ├── controllers/      # Custom controllers
│   ├── helpers.php       # Helper functions
│   ├── filters.php       # WordPress filters
│   └── setup.php         # Theme setup
├── resources/
│   ├── views/            # Blade templates
│   ├── styles/           # CSS/SASS
│   └── scripts/          # JavaScript
├── public/               # Built assets (generated)
├── composer.json
├── package.json
└── bud.config.js         # Build configuration
```

## Key Files

### app/setup.php

Theme configuration and WordPress setup:

```php
add_action('after_setup_theme', function () {
    // Enable features
    add_theme_support('title-tag');
    add_theme_support('post-thumbnails');
    add_theme_support('html5', [
        'caption',
        'comment-form',
        'comment-list',
        'gallery',
        'search-form'
    ]);
});
```

### app/helpers.php

Custom helper functions available in Blade templates:

```php
function custom_helper() {
    return 'value';
}
```

## Controllers

Organize data logic in controllers:

```php
// app/controllers/PageController.php
namespace App\Controllers;

class PageController extends \App\Controllers\Controller
{
    public function page()
    {
        return $this->view->make('page', [
            'title' => get_the_title(),
            'content' => apply_filters('the_content', get_the_content()),
        ]);
    }
}
```

## Filters

Modify WordPress behavior:

```php
// Remove emoji scripts
remove_action('wp_head', 'print_emoji_detection_script', 7);

// Custom excerpt length
add_filter('excerpt_length', function ($length) {
    return 20;
});
```

## Common Issues

### HMR Not Working

Check `bud.config.js` proxy settings:

```js
.proxy('http://localhost:3000') // WordPress URL
```

### Images Not Loading

Use `@asset()` directive in Blade:

```blade
<img src="@asset('images/logo.png')" alt="Logo">
```

### Styles Not Applying

Ensure `@styles` directive in layout:

```blade
{{ wp_head() }}
{{-- Bud automatically injects styles --}}
```
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 198kUpdated Claude CodeCodexVerifiedInstall