Experimenting with Wordpress child themes and overriding template-tags.php

I recently realized a small project with Wordpress. If I do get my hands dirty, the projects are really tiny so I usually resort to very simple platforms such as Squarespace, wix.com or indexhibit. Just anecdotally I believed Wordpress has become to complex and the time vs. quality ratio of pulling together a good Wordpress platform (with different plugins, template configurations and so on) is just not worth it. But as so many sites on the web are powered by Wordpress I wanted to give it another shot.I must say in current version 4.9.1 Wordpress feels swift and powerful and also -in my view- the documentation improved and is now really easy to understand. So it was quite fun to set up the project.Some things did not change: So either you fork $ for really complex and customizable themes or you start with a free theme and will eventually have to adapt it. Really any kind of intimate visual tweaks do require some jumps to the php / css code editor. I learned that my old copy paste approach is not the way to adapt themes. So I created a proper child theme. The procedure works fine but I must say.. again.. comparing it to Squarespace or the like: It is quite an intricate operation for something as simple as adapting an existing theme.So I got basic custom styles and formats in and .. fast forward .. I needed to adapt some entry-meta-information. This resulted in the need to change php functions in:

template-tags.php

I used the good old child approach and simply tried to override the file in

<theme folder>/inc

But it turns out this approach does not override the functions loaded in the parents function tree. :-(I googled and this forum post explains it very well:https://wordpress.org/support/topic/customizing-inctemplate-functions-php-in-child-theme/So the solution is to take great care in how the classes and functions are loading. And when you really step into this order of functions loading (pls. see the link above) than you can make it work and get your custom tags and stylings in.

Previous
Previous

CES 2018

Next
Next

HEIF HEIC Converter for Windows