A recipe for happiness and success

Hard to add or subtract anything from Dustin Curtis’ recipe:


Wake up early. Show up. Learn how to think. Be genuine, but appear nice. Use envy for motivation instead of destruction. Do what you say you’re going to do. Ensure balance in every area of your life. Confront repressed thoughts immediately. Surround yourself with people who are better than you (but remember the thing about envy). Work out every day. Be good at what you do. Make money doing what you love. Have good friends. Never settle.

This is my personal recipe for happiness and success.

The part in the middle is particularly good, so make sure you don’t miss a single word of it:

Wake up early. Show up. Learn how to think. Be genuine, but appear nice. Use envy for motivation instead of destruction. Do what you say you’re going to do. Ensure balance in every area of your life. Confront repressed thoughts immediately. Surround yourself with people who are better than you (but remember the thing about envy). Work out every day. Be good at what you do. Make money doing what you love. Have good friends. Never settle.

And the first part is essential too:


Be sure to read it in its natural environment, and have a look around while you’re there.

Which template — an essential theme development function

So you’re developing a theme for a new project that you’re working on. It has lots of queries, a few different content types, a custom taxonomy or two, etc… It can often be difficult to determine what template is generating the page you’re looking at on the screen. Is this page using page.php, page-{slug}.php, single.php, taxonomy-{taxonomy}-{slug}.php ? You get the idea.

I use this function on every single site I develop, but don’t often see it being used out there in the wild. Just pop this function into your functions.php file and it will output the current template file being used to the bottom of your page:

 * Print out the current template file to the footer.
 * Remove before launch. 

function waterstreetgm_which_template() {
	if ( is_super_admin() ) {
		global $template;
		echo '<strong>Template file:</strong>';
		print_r( $template );
add_action( 'wp_footer', 'waterstreetgm_which_template' );

Bones and Underscores— a WordPress theme head-to-head

Update: I’ve finally finished the follow-up post. Read the update when you’re all done here!

I have a big week coming up. I’m starting two brand new projects and I’m pitting two top WordPress starter themes against each other in a battle royale:


First up, we have Underscores from the Theme Team at Automattic. It is very clean and stripped down, and truly satisfies the ‘starter theme’ criteria. It comes with the barest of necessities, but leaves nothing out at the same time. For you old-schoolers out there, you might notice that a lot of Underscores looks very similar to Toolbox, it’s predecessor. In short: Toolbox was a good starting point for developing themes and Underscores is a great one. Let’s have some pros and cons:


  • Underscores is familiar. This is really only important to me, but it still matters. I used Toolbox on a lot of projects, and still use my fork of it—Victoria Park—for lots of things today. I used Underscores a few times in the past few months and it really feels like an updated version of what I already like.
  • Underscores uses the get_template_part pattern for abstracting template files. I really like this way of thinking about templates.
  • Aesthetics matter and the website for the project is great.


  • Doesn’t use LESS or SASS. This is such an easy issue to fix (rename style.css > style.less and have LiveReload watch the folder) that it hardly warrants a bullet point, but it’s an important distinction from the direction Bones has chosen to take.
  • The name. I’ve never really liked the name ‘_s‘, which is an extremely unimportant detail until you go to start a project and have to find and replace all instances of ‘_s’ with ‘my_project_name’. Again, it’s absolutely not a huge deal, but it was a bit of a pain. The pain is now pretty-well completely alleviated by the project’s website—you can now just enter the name of the project and all the finding and replacing will be cleverly done for you.
  • Not responsive. I know, I know. You shouldn’t let a project’s boilerplate dictate your media query breakpoints, etc etc…and its something you can (should?) easily add yourself, but I still wish there were a few breakpoints baked in.
  • Eric Meyer’s style reset. This one would have been so insignificant a few years ago, but really drives me crazy now. If you’ve ever inspected a single element in Chrome dev tools or Firebug, you’ll know why. Meyer’s style reset, fills your inspector window thusly every time you click on an element:

    This clutter will show up for every single element you inspect. It’s not a huge deal, and you can remove the style reset and roll your own, but I still wish it wasn’t there to begin with.
  • Too spartan out of the box. I’ve always found Toolbox and Underscores to be way too spartan from the outset:
    While I understand that this is meant to be just a starting point, I still don’t find it warm and cosy when I start a new project.


Bones is a hot new theme from Eddie Machado. It’s much more opinionated than Underscores and comes with a few more things under the hood. Before we weigh out the benefits, I need to disclaim up front that I’ve not yet used Bones for a project, so all of the opinions below are just wild speculation. But let’s do it anyway:


  • Responsive. Bones has a responsive grid baked right in
  • Looks good from the get-go Bones isn’t spartan from the start. It has a basic layout ready for you, and overall feels a little better than Underscores does. Sure, you’re still going to undo all of these starting points (the pink headings, etc) but it still feels better to me to start with something out of the box:
  • Normalize.css. If you’ve never used Normalize.css from Nicolas Gallagher and Jonathan Neal it’s worth a look. It does the job of resetting quite well, without cluttering up your inspector window.
  • LESS/SASS from the start. Here’s where the opinionated part comes in. I love that Bones insists that you should be using a CSS pre-processor (and you should) and makes the two most common options available to you
  • Verbose documentation. Some might find this level of documentation to be overkill, but I think it’s going to be helpful to leave it in for at least the first few projects. Machado crams a lot of WordPress know-how into each and every line.


This is the part where the comparision goes off the rails a bit. Given that this is really a setup post and not a followup, and that I’ve not actually used Bones yet, I can only list a few cons that come to mind when poking through the project’s files and folders

  • Modernizr. I don’t use modernizer. At the moment, it feels like this will add unneeded overhead for me. I have no idea. I might use Modernizr for every project henceforth, but for now it feels like it might get in the way
  • No get_template_part. Bones doesn’t use the get_template_part pattern, instead loading a lot of functionality into index.php. This doesn’t mean that I can’t do things the way I like, but is still not ideal for me.
  • Bones is opinionated. I’m not actually sure yet if this is a pro or a con. Opinionated code is great for beginners and people who have the same ingrained opinions. It will be interesting to see if my Machado and I do things the same way. It will be very interesting to see if I come around to his way of thinking if we don’t!

So there we have it. Underscores and Bones in a tête-à-tête. Results to follow!

Why I keep books

My wife gives me a hard time about keeping books I’ve already read or are unlikely to read. Maybe she doesn’t give me that hard a time, but she always questions why I keep these books around. Though I didn’t realize it until now, I keep books around for the same reason Seth Godin does:

I used to have 3,000 books in my old office. When I moved to my new office, I gave away 2,500 of them and I miss them every day—not because I opened them, but because looking at them reminded me of what was inside.

And that seems like reason enough for me, too.

On Programming

Programming is much closer to a craft than a science or engineering discipline. It’s a combination of skill and experience expressed through tools. The craftsman chooses specific tools (and sometimes makes their own) and learns to use them to create.

—From John Graham Cumming.

This is the best description of programming that I’ve ever read. It’s never felt like an art or a science to me, and it hasn’t gotten easier with more time, reading, or research. The only modest strides I’ve made in the past few years with becoming a better programmer have involved building actual things, solving actual problems.

My brother, a craftsman — an industrial electrician— spends his days fixing million dollar undersea pumps, huge diesel generators,  and motors of all shapes and sizes. In the past few years, I’ve noticed a trend in how he talks about the things that he works on — he compares them. This pump works like that pump, but has this kind of motor in it, for example. Things like that. Every problem he runs into is thought of in the context of a similar problem that he’s already encountered.

As I’ve learned more and more these past few years about PHP and Javascript, I’m finding myself do the same. I first look at a problem not in terms of exactly how I get started or what steps are involved, but instead I try and find a previous solution to compare it to. I’m sure as time goes on this will become automatic and not conscious, but it’s really become my first step now.

Thinking about this as a craft — a combination of skill and experience — instead of just as a pure you-have-it-or-you-don’t skill has been extremely helpful to me.