0

I have been using quark a lot which is a starter theme.

I have been using a child theme with quark for a few reasons:

  • Clear separation of code
  • Ability to easily update quark on theme updates

As I have become more in tune with the theme and wordpress, I am trying to reduce the load and resources to ensure speed and efficiency.

I am now debating the use of a child theme - Mainly because I know a child theme already adds additional resources

e.g. it requires 2 x style.css (parent and child) and sometimes, overwriting styles is cumbersome and creates extra code which wouldn't be required by using starter theme in standalone - I could just delete the code.

The same goes for functions.php - quark loads 2 x google fonts - if i dont use them and load my own google fonts, i end up loading resources that are superfluous.

BUT, using a starter theme disables the ability to easily update to the latest theme when a new version is released...

So... I guess I want to know if I am correct - is this just the "rub of the green" and effectively I have to sum up whether I want to deal with a few extra resources versus the inability to auto-update my theme?

Or am I missing some unique concept to each method?

2 Answers 2

1

Definitely use a child theme!

Quark was well designed with child themes in mind.

These are tips, how to deal with your concerns about styles and functions.php files:

"e.g. it requires 2 x style.css (parent and child) and sometimes, overwriting styles is cumbersome and creates extra code which wouldn't be required by using starter theme in standalone."

Keep styles.css empty in a child theme. Enqueue parent styles.css in child's functions.php with the following code:

add_action( 'wp_enqueue_scripts', 'wpse_child_theme_scripts' );
function wpse_child_theme_scripts() {
    wp_enqueue_style( 'parent-theme-css', get_template_directory_uri() . '/style.css' );
}

Use Customize -> Additional CSS to override parent's styles and to add new CSS rules.

"The same goes for functions.php - quark loads 2 x google fonts - if i dont use them and load my own google fonts, i end up loading resources that are superfluous."

As I mentioned before, Quark, being well designed, allows overriding parent theme functions in your child theme. To load google fonts on your own, put the following code in child's functions.php:

function quark_fonts_url() {
   // your code to load fonts goes here...
}

Parent's function quark_fonts_url is a pluggable function, so it will be replaced by your function, declared in child's functions.php. Only your fonts will be loaded.

There are many pluggable functions in Quark. If you want to change their functionality, you can override them in your child theme.

With the child theme approach, being immune to loss of your modifications upon Quark updates, you gain very high level of flexibility.

1
  • Keep styles.css empty in a child theme. Enqueue parent styles.css in child's functions.php with the following code: - Quark auto-enqueue's parent style. Leaving the style.css empty doesn't stop the request from the browser for the file does it? And with the amount of styling used, the "Additional CSS" becomes a bit cumbersome. Yes, loading Google fonts can be circumvented... I am a child theme advocate and I think this just confirms my thoughts - thanks Commented Sep 18, 2017 at 0:15
1

In general I would say that a child theme is an outdated concept. The major problem with it is not so much performance, but more an issue with the developers of parent themes that do not keep backward compatibility to ensure that whatever mods which were done with child themes will actually keep working, and too many times upgrade of a parent theme result in breakage.

With GIT being easily available and almost everybody uses it, I do not find any reason to limit yourself to writing child themes as it is as easy to just have a GIT with the parent theme, branch it for your development, and update it with new versions of the parent theme and merge into the development branch.

I would not put too much emphasize on performance, as for most sites it is an irrelevance (most just don't get enough traffic for performance to actually matter) but will decide on such matters based on the client and use of the theme (non technical clients will probably prefer child themes to be able to upgrade them with ease when there are new versions, more technical clients are likely to be more aware of the pitfuls and have someone that can actually use git around).

7
  • I experienced this with spacious theme - they renamed a function breaking every child theme I had created. I don't use GIT though so not that simple maintaining updates. Performance matters when you're trying to manage server load - not necessarily account level Commented Sep 18, 2017 at 0:12
  • performance matters, it is just matters rarely for most wordpress sites, so it probably depends on the type of theme and clients. Still many performance issues can be handled by using a caching plugin. As for not using GIT, you should learn, but this definitely narrows down your options. Commented Sep 18, 2017 at 2:35
  • I tried GIT. It's not very easy - Just had too many issues setting up repositories and connections and I don't have a spare hour or two to figure it out. Commented Sep 19, 2017 at 3:08
  • this might sound harsher than I mean it, but using GIT or any other change tracking is software development 101. You should invest the time in learning how to use it before you reach the stage in which your code gets big enough to not being able to remember why it is written that way and how did it work before. Commented Sep 19, 2017 at 4:19
  • I appreciate the feedback and can set he benefits. 99% of my work is building small business websites - the code base is tiny and manageable using dropbox. I have actually tried using git - I dedicated a day to it but I couldn't get it working - all the help guides just didn't work and I didn't have time to figure it out so moved on Commented Sep 20, 2017 at 2:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.