Site logo

Archived topic

Problem/question creating child theme

3 replies · Started by Dietrich on May 14, 2020

Viewing posts 1–4 of 4

dear support team!

I just purchased a GeneratePress license and am pretty happy about all the options. Just one question that came up when I generated a child theme. I used the Child Theme Generator to do so and it creates a functions.php file that enques the parent & child theme. As stated on your website, I tried to delete this function (deleting the whole provided code in functions.php) but WP won't allow this and gives out the following error:

"Communication with the website to check for fatal errors was not possible, so the PHP change was undone. You will need to upload your modified PHP file using other means, such as SFTP."

This is the code in functions, I am deleting all of it:

<?php
/*This file is part of GeneratePressChild, generatepress child theme.

All functions of this file will be loaded before of parent theme functions.
Learn more at https://codex.wordpress.org/Child_Themes.

Note: this function loads the parent stylesheet before, then child theme stylesheet
(leave it in place unless you know what you are doing.)
*/

if ( ! function_exists( 'suffice_child_enqueue_child_styles' ) ) {
function GeneratePressChild_enqueue_child_styles() {
// loading parent style
wp_register_style(
'parente2-style',
get_template_directory_uri() . '/style.css'
);

wp_enqueue_style( 'parente2-style' );
// loading child style
wp_register_style(
'childe2-style',
get_stylesheet_directory_uri() . '/style.css'
);
wp_enqueue_style( 'childe2-style');
}
}
add_action( 'wp_enqueue_scripts', 'GeneratePressChild_enqueue_child_styles' );

Any idea if I am doing something wrong? Should I not delete all but just a section?

Grateful for any advice!
D

Hi Matthias, thanks so much for your reply - this worked!

Thanks Matthias - glad to hear its working Dietrich

This archived topic is closed to new replies.