Sticky Post Support in Carrington Core

Carrington Core hasn’t changed much over the last few years. It’s stable, does what it’s supposed to do, and is extensible via standard WordPress APIs. Last night I merged in code to implement a new/overlooked feature for the first time in quite a while: support for sticky posts.

This is part of the posts context, so it is applied in the content/ and excerpt/ directories (as well as in the general context for single post views. Examples:

  • content/sticky.php
  • header/single-sticky.php

For now I’ve set the default priority for this template very high – right at the top. The thinking is that if you are wanting to style sticky posts in a particular way this is probably something you prefer to other view templates. Of course, the priority is filtered so you can customize it as needed on a per-site basis.

Carrington Core is a way of organizing your WordPress theme markup that obviates the need for conditional logic (big if/else statements) in the template files. It’s a system for building websites with WordPress rather than a parent/child theme :scare: framework :/scare: for building themes. Years ago we realized that conditional code in templates was the main cause of headaches in sites that we were maintaining. Carrington Core was built as the solution (and it’s worked beautifully).

I know that the documentation around Carrington Core is laughably bad. I’m hoping we’ll be able to improve that soon (we’re hiring!). So many ideas and projects, so little time… In the meantime, grab the code or contribute on GitHub.

This post is part of the project: Carrington Core. View the project timeline for more context on this post.