Say what?! Seriously?

Yes, seriously. Although this sort of thing is not too likely to exist in the wild here are a few tips and idea to keep in mind when developing a theme.

Let’s start from the end with ‘post-format’ posts and work our way back to the beginning. It wasn’t all that long ago WordPress introduced default post-formats that could be easily added to themes. Here’s a one-liner to put in your functions.php file that does it all, well it’s a good example from the codex showing two post-formats:

add_theme_support( 'post-formats', array( 'aside', 'gallery' ) )
To read more about Post Formats, click hereTo hide the Post Formats click here.
There are nine (9) default ‘post-formats’ as of this writing; there may be more added in the future but these work well. The number of ways end-users might use them is not much less than the ideas they can imagine.

Following is the complete “supported” list. You can visit the codex for what some might consider their recommended usages.

  • aside
  • gallery
  • link
  • image
  • quote
  • status
  • video
  • audio
  • chat

Post-formats have been around since WordPress Version 3.1, if you are not familiar with them yet you should go back and read more about them.

Our next step back is to Sticky Posts introduced back in version 2.7. If you are not familiar with sticky posts then definitely take a few moments to read the articles linked to … I can wait.

So far, so good … right? Good!

Now let’s get to the beginning of the post title: No-Title; and, yes, this is something that should be addressed when developing a theme. The Shadow knows … otherwise one may never know the imagination of the end-user, or if their personal taste demands one (or many) posts are published without a title. Generally speaking, each of these items are handled well enough on their own but what happens when you combine them? If you have thoroughly tested your theme then most any combination of these elements should have been easily and clearly addressed; most of which can be done with simple CSS, too.

The key CSS elements to address for these items are the following:

  • .format-aside
  • .format-gallery
  • .format-< post-format > – substitute < post-format > with the appropriate term
  • .sticky

There may, or may not, be a theme CSS element used for a post without a title but that is well beyond the scope of this post; just remember to test each ‘post-format’ with and without a title.

Now last, but not least, the simple CSS element to remember for the final testing: ‘.format-< post-format >.sticky’ … again substituting the < post-format > for *all* of the ‘post-formats’ used in the theme. Note there is no space between, for example, .format-aside and .sticky the element would be: .format-aside.sticky … these elements are automatically generated by WordPress if the theme uses the `post_class` function correctly.

Granted this was a bit long written but hopefully helpful. It’s just something I found that required a lot more to properly address than what I first suspected as I was updating my theme Desk Mess Mirrored to version 2.0.