Carrington Core For Maintainable WordPress Websites
Alex King
Goals
• Create maintainable websites
• Make functionality and features more obvious
• Make WP theme development more accessible to front-end devs
Principles
• Convention over code (it’s a framework)
• More templates > More conditional code
• 100% addative
• Developer-friendly abstraction levels
Lots of Directories!
• DON’T PANIC
• This is the same WordPress structure you know and love
Structure Posts
Single
Page
HeaderContent/Excerpt Sidebar FooterLoop
Comments
Context Types
• COMMENT = comment & user info(dir: comment)
• POST = individual post/page info(dirs: content, excerpt - single)
• GENERAL = type of page(dirs: header, sidebar, footer, loop, posts)
General Templates Header, Sidebar, Footer
• {dir}-default.php
• home.php
• search.php
• single.php
• page.php
• author.php
• author-{username}.php
• role-{role}.php
• type-{post-type}.php
• category.php
• cat-{slug}.php
• tag.php
• tag-{slug}.php
• tax-{taxonomy-slug}- {term-slug}.php
• tax-{taxonomy-slug}.php
• single-{content}.php (cat, tag, author, meta, etc.)
Post Templates Content, Excerpt
• {dir}-default.php
• author-{username}.php
• meta-{key}-{value}.php
• meta-{key}.php
• format-{slug}.php
• tax-{tax-slug}-{term-slug}.php
• cat-{slug}.php
• tag-{slug}.php
• type-{post-type}.php
• role-{role}.php
• parent-{slug}.php
• page.php
• {feed-}(template).php
Single & Feed (Post Context)
• on single pages by prefixing with {single-} (cat, tag, author, meta, etc.)
• in RSS and Atom feeds by prefixing with {feed-} (feed-format-status.php, etc.)
You can use the Post context template selection:
Comment Templates
• comment-default.php
• author.php
• user-{username}.php
• role-{role}.php
• ping.php
• meta-{key}-{value}.php
• meta-{key}.php
Child Themes
• Available templates are merged
• Templates in child theme stomp those in parent theme
Example
Resources• GitHub Repos
github.com/crowdfavorite/wp-carrington-coregithub.com/crowdfavorite/wp-carrington-core-docsgithub.com/crowdfavorite/wp-carrington-blueprint
• Example Theme: FavePersonal crowdfavorite.com/favepersonal/
• Future: Tutorials and Reference Docscrowdfavorite.com/carrington-core/