Software Engineering in WordPress, PHP, and Backend Development

Tag: WordPress (Page 173 of 219)

Articles, tips, and resources for WordPress-based development.

WordPress Theme Development: Know Your Customer – The Blogger

When it comes to WordPress theme development, one or the areas that developers often find themselves wrestling with is just how verbose they should make their code.

For example, we’re often taught and strive from principles such as DRY and KISS, but it’s hard to maintain both of these when building WordPress themes from the ground up.

For example (and as according to the Codex):

At the very minimum, a WordPress Theme consists of two files:

– style.css

– index.php

And for anyone who has done extensive work in WordPress development knows this to be true; however, if you’re getting into theme development – that is, specifically for bloggers, or digital publishers – then you know there’s a wide variety of templates that are also supposed by the WordPress Template Hierarchy.

To name a few:

  • style.css
  • rtl.css
  • editor-style.css
  • archives.php
  • author.php
  • category.php
  • comments.php
  • date.php
  • index.php
  • single.php
  • tag.php
  • …and so many more

But here’s the deal: it’s nearly impossible to embrace DRY while simultaneously trying to implement each of these templates.

Instead, we’re left with having to repeat a variety of code all the while doing so when much of the code could be produced though template parts and conditional logic.

Though I’m sure we all fall somewhere in between on this issue, he’s where I’ve landed with respect to the various themes that I’ve developed over the last couples of years.

Continue reading

WordPress Settings API Wrapper? No Thanks.

From time to time, I end up having conversations with other developers about the state of the WordPress Settings API, whether or not there should be wrappers for it, and/or how the current API can be improved.

Each time the conversation begins, it generally stems from the fact that the Settings API is confusing, can be very intimidating to work with the first time, and it’s not as intuitive as some of the other WordPress APIs.

As with anyone who’s worked with WordPress long enough, I have my own opinions about this – and this is certainly not a “patches welcome” post – because this has been already been discussed at great length on Trac.

Instead, this is nothing more than my general stance on the WordPress Settings API, and how I see wrappers fitting into the scope of overall WordPress Development.

Continue reading

How To Add Google Fonts To The WordPress Editor

When it comes to building themes in WordPress, one of the nicest things that you can do for your users is to implement a stylesheet specifically for the editor so that they get a true WYSIWYG experience.

To be more specific, that is you can (and should!) add a stylesheet specifically for the WYSIWYG editor in the WordPress Dashboard. This stylesheet is normally called `editor-style.css`, but can actually be called whatever it is that you’d like permitting that you enqueue it properly.

With the popularity of web fonts rising – such as those from Google – you have to take a slightly different approach when implementing them in the context of the editor rather than the typical way of doing so with server side hooks.

Continue reading

A Strategy To Separate Comments and Pingbacks in WordPress

One of the luxuries offered by WordPress – in addition to the commenting system – is the ability to know when someone has given us a ping or a trackback by mentioning us through another blog and linking back to a given post.

If you’ve ever developed themes, then you’re familiar with the need to display both comments and trackbacks someone in the single post page; however, sometimes you want to separate the two from one another so not to clutter the discussion.

The WordPress API makes this possible in a couple of ways, but there’s one way that I find myself preferring over the others for which I tend to think lends itself to cleaner code, though I’m interested in your feedback on this.

Continue reading

Update Your WordPress Projects on GitHub with the GitHub Updater

It’s no secret that many open source developers love GitHub – it’s an amazing service that makes sharing and working on open source projects really easy, both from a project management standpoint, and from a developer/contributor standpoint.

But if you’re in the business of building WordPress plugins, and you enjoy taking advantage of the services offered by the GitHub plugin repository, then one of the things that makes it difficult to keep your work on GitHub is the lack of ability to update your plugin.

Of course, projects have been released that allow you to sync both repositories, but if you’re interested in going 100% with GitHub, then check out the GitHub Updater Plugin.

Continue reading

« Older posts Newer posts »

© 2025 Tom McFarlin

Theme by Anders NorenUp ↑