classic-theme-loop-template-parts
Installation
SKILL.md
Classic Theme Loop and Template Parts
Use this when creating or reviewing the content rendering layer of a classic PHP WordPress theme: main loops, content.php style partials, archive cards, single post bodies, page bodies, empty states, and pagination.
This is not a block/FSE template-part skill. Use PHP template files and get_template_part().
When to Use This Skill
- Writing
index.php,home.php,archive.php,search.php,single.php,page.php, or404.php. - Moving repeated markup into
template-parts/content*.php. - Reviewing a nested
WP_Query, featured-post section, related posts section, or custom loop. - Fixing pagination, no-results output, post classes, content/excerpt choice, or "wrong global post" bugs.
Main Loop Contract
For the main query, use WordPress' loop state. Do not replace it with query_posts().