The following is based upon codex instructions for creating a child theme. It is specifically a shortcut to create a child theme for WordPress theme Twenty Twenty.
Read the codex here: How to create a child theme>>>
Here are the highlights to override Twenty Twenty:
- Create a folder in your theme folder using ftp or your cpanel file manager. Name it your theme name (no spaces)
- Create a file called style.css in this new folder
- Put this in the file and save
/*
Theme Name: Your Theme Name (you can use spaces here)
Theme URI: your site's url
Description: Twenty Twenty Child Theme
Author: Your name
Author URI: optional
Template: twentytwenty (this is the parent theme text domain so it matters)
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yourthemename optional text if you plan to use __()
*/
- Create a file called functions.php in your new theme folder. Add the “< ? php” on line one (spaces here are intentional). Then add and save:
function twentytwenty_styles() { wp_enqueue_style( 'parent', get_template_directory_uri() . '/style.css' ); } add_action( 'wp_enqueue_scripts', 'twentytwenty_styles'); /* remove inline styles (optional) */ add_action( 'wp_enqueue_scripts', function() { $styles = wp_styles(); $styles->add_data( 'twentytwenty-style', 'rtl', '' ); }, 20 );
- Next you can add the footer.php file as HERE. Just copy the twenty twenty footer.php file and remove the powered-by-wordpress section.