0

Can anyone assist with helping me load a child theme for 'Hoffman'. I've seen so many questions around this similar subject for other themes and it seems to be a common thing that a lot of WP newbs like myself seem to struggle with.

I can load the parent theme perfectly without any problems. But I'm struggling with two things.

  1. What detail should be at the top of the style.css on the child theme? At the moment, I have:

/*---------------------------------------------------------------------------------
Theme Name: Hoffman Child
Text Domain: hoffman child
Theme URI: http://www.andersnoren.se/teman/hoffman-wordpress-theme/
Version: 1.17
Description: Hoffman is a beautifully minimal, responsive and retina-ready theme for bloggers. It features a social icon menu, Jetpack support for infinite scroll, five custom widgets, two page templates, editor styling, translation-ready code, custom accent color support, custom background support, support for the gallery post format and much more. Included translations: Swedish/svenska. Demo: http://www.andersnoren.se/themes/hoffman/
Tags: blog, one-column, custom-colors, custom-menu, editor-style, featured-images, footer-widgets, post-formats, sticky-post, theme-options, threaded-comments, translation-ready
Author: Anders Norén
Author URI: http://www.andersnoren.se
License: GNU General Public License version 2.0
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Template: hoffman;

All files, unless otherwise stated, are released under the GNU General Public License
version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html)
-----------------------------------------------------------------------------------*/

@import url("../hoffman/style.css");

I've tried a few different versions of this where I didn't amend the text domain.

  1. The second issue, is that when the child theme is zipped and I attempt to upload it, it can't seem to find the parent theme, even though the parent theme was loaded successfully and working perfectly in WP. When uploading the hoffman-child.zip, this is the report I receive as it goes through the motions:

Installing Theme from uploaded file: hoffman-child.zip Unpacking the package…

Installing the theme…

This theme requires a parent theme. Checking if it is installed…

Preparing to install Hoffman 1.17…

Downloading install package from https://downloads.wordpress.org/theme/hoffman.1.17.zip

Unpacking the package…

Installing the theme…

Destination folder already exists. /var/www/vhosts/smokeandglass.co.uk/httpdocs/wordpress/wp-content/themes/hoffman/

Theme install failed.

Theme installed successfully.

Totally confused! Many thanks for your help in advance.

3
  • Lots of well organized details here: codex.wordpress.org/Child_Themes
    – jdm2112
    Commented Dec 13, 2016 at 17:47
  • Thank you. Very helpful. Will see if this makes any difference. Incredibly frustrating that child themes aren't included as standard. Maybe I need to lower my expectation slider!
    – Goardo
    Commented Dec 13, 2016 at 17:51
  • One thing that stood out to me was the Template value. It should be hoffman and not hoffman; (don't add a trailing ;) Commented Dec 13, 2016 at 22:26

1 Answer 1

0

As jdm2112 suggested, the WP Codex had a well-detailed explanation. A few observations based on your question:

  1. The text domain shouldn't contain spaces
  2. The "Template" value should be the same as the directory name of your parent theme (check it)
  3. Make sure the child theme directory name is different from the parent theme, convention is to call it yourparenttheme-child where yourparenttheme is the directory name of your parent theme
  4. Why zip the folder? Simply upload the directory to /wp-content/themes/

  5. Don't forget to add the functions.php file

  6. You should install the parent theme first, then the child theme

This is the standard header of a child theme (WP docs):

/*
 Theme Name:   Twenty Fifteen Child
 Theme URI:    http://example.com/twenty-fifteen-child/
 Description:  Twenty Fifteen Child Theme
 Author:       John Doe
 Author URI:   http://example.com
 Template:     twentyfifteen
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready
 Text Domain:  twenty-fifteen-child
*/

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.