Templating is becoming more common in WordPress, and I consider that a good thing.
But that doesn’t mean that there aren’t projects that we manage that use a more traditional approach to displaying templates or partials. Furthermore, it also doesn’t mean that we’re exempt from maintaining codebases that use code that does not use a templating engine.
Though I think templating is good, I don’t think it’s always necessary. That’s content for another post, though.
Instead, I want to walk through the process of using the conditional logic of whether or not to display a partial within a template and do so using object-oriented programming.