Skip to content

Child theme and custom code

Do I need the child theme?

Only if you'll edit theme files or add PHP. For colors, fonts, layout and small CSS changes, Theme Options is enough: Theme Options → Custom code → Custom CSS survives updates without a child theme.

Setting it up

The easiest way is the Child theme step of the setup wizard (Terrifico → Setup wizard). It creates Terrifico Pro Child in wp-content/themes/terrifico-pro-child/, copies your menus, widgets, logo and Customizer settings into it and activates it. Theme Options are shared, so they carry over automatically.

Or install terrifico-pro-child.zip from the package under Appearance → Themes → Add New → Upload, then activate it. In that case, set your menus and widgets again under Appearance.

What goes where

File For
style.css Your CSS. It loads after the theme's styles, so your rules win
functions.php PHP snippets: hooks, filters, extra scripts
Template files Copy a template from terrifico-pro/ (for example footer.php) into the child theme and edit the copy. WordPress uses the child's version

Copying a template means you won't get improvements to that file in later updates, so prefer CSS and hooks where you can.

Useful hooks

Terrifico follows WordPress conventions, so standard hooks such as wp_head, wp_footer, wp_body_open and body_class all work. Theme Options can be read in PHP with:

$primary = \Terrifico\Theme\Options\Repository::get( 'colors.primary' );

The option keys are the names shown in Theme Options → Backup & history → Export settings.

Back to top