Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

Proof of concepts for pre-populating / overriding / disabling the customizer in WordPress child themes.

Notifications You must be signed in to change notification settings

dotherightthing/wp-customizer-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

wp-customizer-demo

Proof of concepts for pre-populating / overriding / disabling the customizer in WordPress child themes.

1. flash-child

Demo child theme for Themegrill - Flash MultiPurpose WordPress Theme.

Problem

I pitched for a job where the client wanted to override the theming options provided by the Flash theme.

change the hero font and color to something that reads better ... No coding should be required. The deliverable I am looking is a theme zip file that can be installed in any wordpress site, and the CSS changes/additions on a separate file.

In Flash as in WordPress, colours and fonts are specified using the WordPress customizer: Appearance > Customise.

It sounded like the client wanted to set these values without using the customiser, so that the changes could easily be replicated to any wordpress site.

Solutions

The WordPress Customizer is helpful for:

  • clients without coding knowledge
  • clients who want to set up 'unique' themes quickly

The WordPress Customizer is unhelpful for:

I thought of several solutions to this:

  1. Ignore whatever value is set in the customizer by overriding the output in a child theme
    • makes the customizer live preview inaccurate
    • could be confusing for authors
  2. Remove the customizer options and hardcode the preferred settings in a child theme's stylesheet
    • requires WET code to duplicate the dynamic inline CSS from the parent theme to the child theme
    • removes functionality that might be useful in some cases
  3. Retain the customizer options but override the defaults with your own in a child theme
    • customise existing functionality rather than overriding it
    • CSS Custom Properties could be used to expose these defaults to the child theme CSS to keep these DRY
  4. Use a WordPress Plugins - Customizer Export/Import plugin to set your preferred customizer settings then export these to a file
    • file could be committed to version control
    • quickly load your preferences when setting up a site
    • still be a manual process.
  5. Implement one of the above options in a plugin instead, if a child theme is already in use
  6. Change to a different theme/framework that is less opinionated about how theming is managed
  7. Change the customizer colour palette to one of your own (this doesn't address the font issue):

WP_Customize_Manager

Kirki

Flash uses the Kirki WordPress Customizer Framework. This is a wrapper for WP_Customize_Manager.

The documentation for the theme is non-technical. You need to go dig into the PHP files to see what's possible.

Known Issues

See TODOs in files.

About

Proof of concepts for pre-populating / overriding / disabling the customizer in WordPress child themes.

Topics

Resources

Stars

Watchers

Forks