I have made a child theme, creating the stlye.css and functions.php files. My theme has multiple * .css and * .php files. The issue is that I can not get the web to show up as the parent theme. Missing elements (mainly in the Homepage). I would like to know the reason for this. I describe below the steps taken so far:
I have created the file style.css with the necessary requirements (field "Template" = name of the parent theme and others).
In the functions.php file I have included the following code: (see code at the end of this writing).
I have tried to locate from which files come some elements of the web that do not appear in the child theme (on the homepage of the web). I indicate some examples below:
-
For example, the="widget-wrap" found in the following file located in the following parent theme path: MusicTheme \ widgets \ class-tmpl-image-gallery.php, not found in the child-theme.
-
Another example: a text that heads a section within the homepage of the web: "New Release Album" and is within the previous one. This text is located in the following file: MusicTheme \ functions \ auto_install \ import-widgets.wie
-
The following text: "This is an example of an event.You could add your" located in the path: MusicTheme \ functions \ auto_install \ music-dummy-data.xml
By doing tests, I chose to copy all the files (php and css) of the parent theme to the child-theme and some of the information that was not shown, already appears in the child theme. However, despite this, some information is still not shown, such as the first section above.
For information purposes, in the "Settings> Reading" section (from the Wordpress desktop) the homepage is defined as: "A static page", with the options: "Homepage: Home" and "Post page" : Blog ".
Issues:
What is the correct way to proceed so that the same web appears to me if the parent theme is activated?
Is it good practice to copy all the php / css files from the parent theme and include them in the child-theme?
Code included in the functions.php (child theme) file:
<?php
function wpshout_enqueue_MusicTheme_stylesheet () {
$parent_style = 'main-music-style';
$bs_style = 'bootstrap-min-style';
$font_style = 'fontawesomecss';
$tmpl_style = 'tmpl-music-style';
$comp_style = 'component-style';
$rtlbs_style = 'tmpl-rtl-bootstrap-style';
$rtlst_style = 'tmpl-rtl-style';
$cust_style = 'tmpl-customizer-css';
$colors_style = 'colors';
$ie_sytle = 'ie';
$child_style = 'main-music-style-child-style';
$child_bs_style = 'bootstrap-min-child-style';
$child_font_style = 'fontawesomecss-child';
$child_tmpl_style = 'tmpl-music-child-style';
$child_comp_style = 'component-child-style';
$child_rtlbs_style = 'tmpl-rtl-bootstrap-child-style';
$child_rtlst_style = 'tmpl-rtl-child-style';
$child_cust_style = 'tmpl-customizer-child-css';
$child_colors_style = 'colors-child';
$child_ie_style = 'ie-child';
wp_enqueue_style( $parent_style,
get_template_directory_uri() . '/style.css' );
wp_enqueue_style( $bs_style,
get_template_directory_uri() . '/css/bootstrap.min.css' );
wp_enqueue_style( $font_style,
get_template_directory_uri() .
'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-
awesome.min.css' );
wp_enqueue_style( $tmpl_style,
get_template_directory_uri() . '/theme-style.css' );
wp_enqueue_style( $comp_style,
get_template_directory_uri() . '/css/component.css' );
wp_enqueue_style( $rtlbs_style,
get_template_directory_uri() . '/css/rtl-bootstrap.css' );
wp_enqueue_style( $rtlst_style,
get_template_directory_uri() . '/css/rtl.css' );
wp_enqueue_style( $cust_style,
get_template_directory_uri() . '/css/admin_style.css' );
wp_enqueue_style( $colors_style,
get_template_directory_uri() . '/css/colors.css' );
wp_enqueue_style( $ie_style,
get_template_directory_uri() . '/css/ie.css' );
wp_enqueue_style( $child_style,
get_stylesheet_directory_uri() . '/style.css',
array( $parent_style ),
wp_get_theme()->get('1.1.2')
);
wp_enqueue_style( $child_bs_style,
get_stylesheet_directory() . '/css/bootstrap.min.css',
array( $bs_style ),
wp_get_theme()->get('1.1.2')
);
wp_enqueue_style( $child_font_style,
get_stylesheet_directory() .
'https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-
awesome.min.css',
array( $font_style ),
wp_get_theme()->get('1.1.2')
);
wp_enqueue_style( $child_tmpl_style,
get_stylesheet_directory() . '/theme-style.css',
array( $tmpl_style ),
wp_get_theme()->get('1.1.2')
);
wp_enqueue_style( $child_comp_style,
get_stylesheet_directory() . '/css/component.css',
array( $comp_style ),
wp_get_theme()->get('1.1.2')
);
wp_enqueue_style( $child_rtlbs_style,
get_stylesheet_directory() . '/css/rtl-bootstrap.css',
array( $rtlbs_style ),
wp_get_theme()->get('1.1.2')
);
wp_enqueue_style( $child_rtlst_style,
get_stylesheet_directory() . '/css/rtl.css',
array( $rtlst_style ),
wp_get_theme()->get('1.1.2')
);
wp_enqueue_style( $child_cust_style,
get_stylesheet_directory() . '/css/admin_style.css',
array( $cust_style ),
wp_get_theme()->get('1.1.2')
);
wp_enqueue_style( $child_colors_style,
get_stylesheet_directory() . '/css/colors.css',
array( $colors_style ),
wp_get_theme()->get('1.1.2')
);
wp_enqueue_style( $child_ie_style,
get_stylesheet_directory() . '/css/ie.css',
array( $ie_style ),
wp_get_theme()->get('1.1.2')
);
}
add_action( 'wp_enqueue_style', 'wpshout_enqueue_MusicTheme_stylesheet' );