Here is what I did to create a child theme so far:
1. Made “magnus-child” folder under wp-content>themes
2. Made “functions.php” and “style.css” files under “magnus-child”.
3. Put this into the css file:
/*
Theme Name: Magnus Child
Theme URI: https://bekero.com
Description: Magnus Child Theme
Author: Beke
Author URI: https://bekero.com
Template: magnus
Version: 1.0.0
License: GNU General Public License version 3.0
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: two-columns, right-sidebar, fixed-width, custom-background, custom-colors, theme-options, translation-ready
Text Domain: magnus-child
*/
4. Put this into the php file:
<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
function use_parent_theme_stylesheet() {
// Use the parent theme's stylesheet
return get_template_directory_uri() . '/style.css';
}
function my_theme_styles() {
$themeVersion = wp_get_theme()->get('Version');
// Enqueue our style.css with our own version
wp_enqueue_style('child-theme-style', get_stylesheet_directory_uri() . '/style.css',
array(), $themeVersion);
}
// Filter get_stylesheet_uri() to return the parent theme's stylesheet
add_filter('stylesheet_uri', 'use_parent_theme_stylesheet');
// Enqueue this theme's scripts and styles (after parent theme)
add_action('wp_enqueue_scripts', 'my_theme_styles', 20);
I would like to know how to correctly put in the respective css files, as there is more than one, for the enqueue process.
In the parent theme folder there is a “style.css” file, and a css folder containing: format.css, prettyPhoto.css, refineslide.css, reset.css, responsive.css, and superfish.css.
Can anyone tell me what corrections to make?