Skip to content

Instantly share code, notes, and snippets.

@dotherightthing
Last active August 15, 2019 07:16
Show Gist options
  • Save dotherightthing/8de558563b0ae41f299ae4f8c81f7976 to your computer and use it in GitHub Desktop.
Save dotherightthing/8de558563b0ae41f299ae4f8c81f7976 to your computer and use it in GitHub Desktop.
[Custom theme requirements] Custom themes are a blank canvas. Well, sort of. #wordpress

Custom theme requirements

Created: 2017.04.14

Requirements

Theoretically a custom theme could fulfil any niche need, and therefore deviate very far from the typical idea of the WordPress 'blog'.

At least, that's what I thought when creating a custom theme to manage my internal knowledgebase.

The reality is, that all themes need to meet certain criteria, and these criteria are very much embedded in the idea of WordPress-as-blog.

The Theme Check plugin

This plugin runs a barrage of tests against would-be themes. Of course there's nothing that says that you have to publish your theme, but ignoring the theme check is a bad idea for several reasons:

  1. Publishing themes and thus freely sharing knowledge is the whole backbone of the WordPress ideology, and lack of compliance is a poor excuse for not giving back
  2. Standards-savvy clients will expect themes to meet basic criteria, and I know that I'd rather avoid lengthy back-and-forth conversations about why my work doesn't do this.
  3. It's nice to have another set of eyes over my work (even if they are blank machine eyes)

Requirement: Comments

Disabling comments is a good option for corporate sites where user input isn't part of the marketing strategy.

Disabling Comments

WordPress freely allows you disable comments and prevent anyone leaving a comment directly (in the comment form) or via a 'ping back' style acknowledgement.

Disabling comments in WordPress. Disabling comments on existing posts.

Theme Check Fail

But the Theme Check plugin will fail you if you don't include redundant comment templating:

No comment errors.

What the Requirements actually say about templates, is:

If you use the relevant templates, your theme should include: ... the_comments_navigation(), the_comments_pagination().

So perhaps this requirement would not be enforced if I only used custom post types, and didn't use the default comment-able post page (single.php)? Or perhaps I need to really disable comments?

But on the other hand, the Theme Check plugin, definitely does flag the missing comment templating as a 'requirement', not an 'option' that I 'should' have.

Requirement: Valid Theme meta (Tags)

When creating my theme boilerplate, I naively threw boilerplate in as a tag. Bad move.

Theme Tags are also in lock down and you can only choose from the 28 pre-approved tags:

Pre-approved theme tags.

Requirement: Display Tags

REQUIRED: This theme doesn't seem to display tags

This one tripped me up, because I was already displaying a Tag Cloud using the built in widget, plugged into the sidebar.

But this requirement is actually referring to the_tags() - specific to a post:

This template tag displays a link to the tag or tags a post belongs to. If no tags are associated with the current entry, nothing is displayed. This tag should be used within The Loop.

This output can then be suppressed by not assigning any tags to a post.

Screenshot size

The theme should include a screenshot.png, to show sighted people what they're getting. But it can't be any old size, it has to be exactly 1200x900.

But wait, what's this Apple? Your 2012 11" MacBook Air only goes up to 1366x768 ? Damn.

MacBook Air 11", circa 2012. Native screen resolution of an 11" MacBook Air.

Well, it's only a Recommendation, but still..

Using a remote device with a larger screen resolution. Refreshing the remote display. Requesting a screenshot. The screenshot image is smaller than the screen size.. Scaling the image size in MacOS Preview. Cropping the image in MacOS Preview. The resulting image is poor quality.

Hmmm, maybe I'll just use a standard BrowserStack screenshot..

The screenshot is only 1050 x 509. My Pixelmator demo has expired. Pixelmator costs 65 NZ dollars.

Hmmm...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment