A Dilemma: Hiding Elements with The WordPress Theme Customizer

When it comes to working with the WordPress Theme Customizer, one of the options that you’re likely to see in other themes (or that you’re likely to introduce in your own themes) is an option that is responsible for toggling the visibility of an element.

For example, if a text box is empty, you may want to hide an element. Or, more simply, perhaps a user will need to click on an checkbox to toggle whether or not to display an element.

But this presents a dilemma: Either we can send all of the information to the browser and control its visibility using a class name, or we can send less code to the browser but lose a smooth user experience when using the Theme Customizer.

Steps To Writing Clean WordPress Code

I’d like to think that one of the things that most good developers continually strive for is writing the cleanest, most maintainable code possible.

Personally, I don’t know if there is an actual point at which you reach it – it’s the whole journey-not-a-destination thing – but that doesn’t mean that we shouldn’t continually aim to get better at what we do. In our case, that’s writing clean WordPress code.

The thing is, there’s only so far you can get on your own. You can read a number of books, follow the advice of some high profile programmers, and read as much of the “academic” material that you can get your hands on – and I think all of the above is great – but, at the same time, it only goes so far.

To that end, I think it’s worth seeking out other people in your same field to help provide some level of mentorship on how it relates to writing clean code because here’s the thing:

As much material as we can read written by other people, nothing beats interacting with those who are writing code in the same language(s) for the same APIs under the same coding standards and who are farther along than you in experience.

How To Define a New WordPress Cron Schedule

Last year, I shared how to properly setup a WordPress cron job in which I walked through the process of defining a cron job in the operating system so that a job fires as a true scheduled task (rather than the faux tasks that WordPress provides).

This isn’t to say that the native WordPress scheduled tasks are bad – they just may not work as expected for those who are used to native cron jobs.

Another limitation of the the WordPress scheduling system is that it defines only a handful of intervals in which your tasks may run. These include:

  • hourly
  • daily
  • twicedaily

And these are fine for a lot of tasks, but if you’re looking to define a new WordPress cron schedule, you’ll need to define a custom filter.

The Importance of Using Domain Language in WordPress

In building software – especially at the enterprise level – one phrase that’s used to describe the work that goes into understanding what all needs to make up an application is that of the “problem space” or the “problem domain.”

This is important because part of the process of understanding the problem domain is learning the language, the terminology, and the concepts that go into building an application.

For example, say you’re building a job board. You’re likely to have something like:

  • Job Posts
  • Resumes
  • Recruiters
  • Employers
  • Employees
  • Candidates
  • …and so on

These ideas are then taken and ultimately converted into code.

Sometimes, developers will use the terminology associated with the problem domain (and this is part of domain-driven design) in their code; other times, the problem may get solved but the code may not completely reflect the problem space at the code level.

At any rate, one of the things that I see – as designers and/or developers – doing is using terminology that is more frequently associated with how we view WordPress than how users do.

Kaizen and WordPress

According to Wikipedia, kaizen is defined like so:

Japanese for “improvement” or “change for the best”, refers to philosophy or practices that focus upon continuous improvement of processes in manufacturing, engineering, business management or any process.

Generally speaking, this is used to talk about the continuous improvement of a product. It’s also a core idea of lean manufacturing that has also been adapted into lean software development.

Anyway, the idea isn’t anything new and I honestly think now, more than ever, more people are familiar with the idea (even if it isn’t practiced) than ever before especially because some applications use the word in the release notes for their application.

Kaizen in Paper By FiftyThree

Paper By FiftyThree mentions it with nearly every release.

As far as building products is concerned, this is something that I think many designers and developers want to do (if they aren’t already doing it, of course), but it are sometimes hindered by the nature of their environment.

By that, I mean that can we do continuous improvement – that is, can we practice kaizen – on projects that aren’t deployed on any type of particular schedule?

How We’re Planning The Next Iteration of the WordPress Plugin Boilerplate

Months ago, I announced that there was going to be a major update to the WordPress Plugin Boilerplate.

Because of its nature in being a hobby project, because this project is something that’s being worked on by a number of contributors, and because the next iteration is going to be a major rewrite of what we have so far, it’s taking a while to begin pushing code for the new Boilerplate.

But there are a lot of neat things coming, and I think that even if it’s taking us a while to get something on GitHub, it’s worth providing updates as to where we currently stand with the project.

Using LighthouseApp For WordPress Issues

One of the things that I love about GitHub is how they’ve done a great job integrating source code, milestones, tickets, pull requests, and so on.

But if you’re working with WordPress, not all projects all on which you work will use GitHub.

Case in point: If you’re selling a theme on WordPress.com or if you’re working on a plugin that is hosted in the WordPress Plugin Repository, then you’re going to be using Subversion as your source control system. But this doesn’t mean that you have to sacrifice the work flow of milestones, tickets, and so on.

It just requires that you use a third-party solution. For example, for the past couple of months, I’ve been using LighthouseApp as my issue tracker of choice for Mayer.

Two Versions of WordPress Themes (“Is It Worth It?”)

When it comes to selling a theme for both WordPress.com and for self-hosted installations, one of the questions that I find myself asking is:

“Is it worth maintaining two repositories for the same theme?”

And I wonder this because when it comes to maintaining a codebase of a theme on WordPress.com and a version for the self-hosted version of WordPress, you can make the case that there’s no need to have a difference in the version of the themes.

But for anyone who has worked in both variants of WordPress, then you know there’s actually little bit in variation.

Managing Email with Flywheel and Pobox Email Forwarding

Late last year, I migrated this site to Flywheel for managed WordPress hosting (which I talked a little bit about in this post). I’ve been incredibly happy with them for a number of reasons, each of which I cover at a later time; however, one of the features that they do not offer is email hosting.

Straight from their support channel:

At Flywheel we believe strongly in working with “best of breed” providers for everything we do, and we view ourselves to be a “best of breed WordPress host.” As such, we do not currently host email for our clients. We make a deliberate effort to focus on building a great WordPress hosting environment – and being the absolute best at it.

I love the mentality and the vision they’re after, but this does leave us needing to look for an alternative host.

They mention Google Apps, Zoho Mail, and Rackspace Email as alternatives, but the last thing that I wanted to do was setup yet-another-email-address.

I have a handful of email addresses all of which forward to a single Gmail box that allow me to respond from the address to which the email was sent, and I wanted to duplicate that for this particular domain.

So I tried one of the recommended solutions for a couple of months, and I couldn’t get it to jive with my workflow (for a number of different reasons, none of which I’m covering here).

This ultimately lead me to try out Pobox.

The Third Version of Live Theme For WordPress

Comments are closed on this post. Please leave comments on the original blog post.

About four years ago, I had the pleasure of working with a team to help deliver the first iteration of Live Theme for WordPress; however, as the team leaned out, changed directions, and paired down our product focus, we sold the product to someone else for continued development and maintenance.

To make a somewhat long (perhaps even boring) story short, I’m currently working on the third version of Live Theme for WordPress.