Skip to main content

An iA3 WordPress child theme

·547 words·3 mins
loothi
Author
loothi
A/s/l/g

I very much enjoy my minimalist theme made by the lovely people at iA3, and have recently discovered that I share it with none other than Slyvester Stallone. I’m in good company, I think you’ll agree.

iA3 sell the theme with the proviso that it’s priced reasonably because they aren’t going to hand hold non-technical WordPress users. It’s not what they love to do. This post is some hacks I’ve added to get it the way I like it.

Firstly, I like the idea of child themes in WordPress. It’s not a perfect way of customising and inheriting theme updates but it’s better than throwing away the previous version which, if you’re like me, you’ll have hacked and then forgotten what you hacked until something disappears on the new site.

So far iA3 have released 3 updates of the theme, so it’s worth considering implementing a child theme if you want to have customisations. I’ve a new theme folder called ia3_child. Inside it I have the following.

A copy of the style.css
#

This is just a pre-requisite for a child theme and only contains the text

\[css\]

@import url("../iA3 1.2/style.css");

\[/css\]

A copy of the index.php
#

This is included to make a few key changes.

  1. Fix the @includes

    By default the iA3 template isn’t coded to have children made from it. The problem is in the php @includes. They link directly to files in the same working directory. To correct this nicely, for each @include you find in a template you want to edit, change

    \[php\]

    \[/php\]

    into

    \[php\]

    \[/php\]

    This function locate_template will search a child theme directory first (if being called from one) then the parent theme directory. It’s neater that way.

  2. Include a hand written excerpt

    To break a long story you can use a ‘quicktag’

    \[html light="true"\]

    \[/html\]

    in your post (described in the_excerpt vs the_content), but if you like a hand written excerpt you’ll have to alter the iA3 template to get it.

    The original index.php contains this for the featured story

    \[php\]

    \[/php\]

    Here is my excerpt enabled version.

    \[php\]

    post\_excerpt )): ?> post\_excerpt; // make sure there are paragraph tags to make nice the stylings. echo preg\_replace('#^(

    )\*(.+?)(

    )\*$#','

    $2

    ',$triffid\_excerpt); ?> // add a Read More link – ‘’.

    \[/php\]

A copy of inc_head.php
#

This file contains the meta information for the header of the pages. It needs to be corrected to include your own site/blog meta description.

\[php\]

\[/php\]

On my wishlist is having this as a theme option.

A copy of folders assets/img
#

In this folder structure I have added my own sprite.png so in my iA3 preferences the link to my logo image is entered as

\[html wraplines="1"\]

http://triffidorg/wp-content/themes/ia3_child/assets/img/sprite.png

\[/html\]

and any subsequent iA3 updates (I think) will always use that URL and image file as the logo.

That’s about it for my small modifications. Big thanks to iA3 and as always I look forward to the updates.

A note for the interested, for this post I installed the WordPress plugin SyntaxHighlighter for the code snippets (v2.x) which is rather nifty.