Carrington Core (2014)

13
Carrington Core For Maintainable WordPress Websites Alex King

description

Create maintainable WordPress websites.

Transcript of Carrington Core (2014)

Page 1: Carrington Core (2014)

Carrington Core For Maintainable WordPress Websites

Alex King

Page 2: Carrington Core (2014)

Goals

• Create maintainable websites

• Make functionality and features more obvious

• Make WP theme development more accessible to front-end devs

Page 3: Carrington Core (2014)

Principles

• Convention over code (it’s a framework)

• More templates > More conditional code

• 100% addative

• Developer-friendly abstraction levels

Page 4: Carrington Core (2014)

Lots of Directories!

• DON’T PANIC

• This is the same WordPress structure you know and love

Page 5: Carrington Core (2014)

Structure Posts

Single

Page

HeaderContent/Excerpt Sidebar FooterLoop

Comments

Page 6: Carrington Core (2014)

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)

Page 7: Carrington Core (2014)

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.)

Page 8: Carrington Core (2014)

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

Page 9: Carrington Core (2014)

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:

Page 10: Carrington Core (2014)

Comment Templates

• comment-default.php

• author.php

• user-{username}.php

• role-{role}.php

• ping.php

• meta-{key}-{value}.php

• meta-{key}.php

Page 11: Carrington Core (2014)

Child Themes

• Available templates are merged

• Templates in child theme stomp those in parent theme

Page 12: Carrington Core (2014)

Example

Page 13: Carrington Core (2014)

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/