Writing: Code snippets

Function Friday #4: add conditional classes to the body tag

If you haven’t spent time looking at WordPress starter/default themes, you may not have come across the body_class function before. It can be useful right out of the box for styling different types of content, but you can also conditionally add classes to this list for further styling.

Continue reading “Function Friday #4: add conditional classes to the body tag”

Function Friday #3: always show a second row of buttons in the Visual Editor

The second row of formatting buttons in the Visual Editor contains some useful ones, but it’s hidden by default. I don’t feel the couple pixels of space saved are worth potentially missing out on the added functionality, so I like to display the second row for all users.

Continue reading “Function Friday #3: always show a second row of buttons in the Visual Editor”

Function Friday #1: custom colour palettes in the Visual Editor

After I’ve launched a WordPress site for a client, I don’t want them to have to contact me to make any updates. To that end, I try to build in as many customization options for them as possible. One quick one is to show their brand/theme colours in the “Text color” colour picker instead of the default palette.

Continue reading “Function Friday #1: custom colour palettes in the Visual Editor”

I write about code, client resources, and nerdy things I like. You can jump straight to the technical stuff or the nontechnical stuff, or find specific topics below.