Skip to content

Creating a child theme

Paal Joachim Romdahl edited this page Nov 12, 2019 · 5 revisions

In creating a child theme you need a few files. A functions.php, a screenshot.jpg and likely a style.css file.

The functions.php should contain the following code if you plan on using a style.css file:

add_action( 'wp_enqueue_scripts', function() { wp_enqueue_style( 'child-style', get_stylesheet_uri() ); });

The style.css should contain this information. I decided to call it Gridd Child.

`/*!

  • Theme Name: Gridd Child
  • Template: gridd
  • Theme URI:
  • Author: Paal Joachim Romdahl
  • Author URI:
  • Version: 1.0.0
  • License: GNU General Public License v2.0 or later
  • License URI: https://www.gnu.org/licenses/gpl-2.0.html
  • Text Domain: griddchild
  • Requires PHP: 5.6
  • Tags: accessibility-ready, block-styles, wide-blocks, translation-ready, custom-background, custom-logo, custom-menu, featured-images, threaded-comments */`

(I am having a difficult time getting the above CSS to show as code.)

I made this creating a child theme as it just fint it important that a theme has a wiki on about what to add to a child theme of the Gridd theme even though there are a lot of tutorials about this.

Clone this wiki locally