Set Up Child Theme

I am trying to set up a Child theme for Alizee Pro.

I set up style.css and functions.php in the child theme folder. It links to the parent theme, but the columns are not functioning properly on the homepage. When it is on desktop version and should be 3 columns, it is only showing 2 article columns. They are the correct width for three columns, but where the third article should be, it is blank.

In tablet view, the same thing happens. It shows one colum of articles with a blank space where the second column of articles should be.

When I activate the parent theme, the columns are correct.

I think the error is in functions.php. I am using “function theme_enqueue_styles()” to call to ‘style.css’. I can give you the full code if that would help.

I cannot include a link, because the site changes are not LIVE to the public.

Please help.

Hi,

This issue happens only on your Child Theme? So if you activate the Parent Theme it’s correct?

Best Regards,
Csaba

Yes, the columns show correctly when the parent theme is active. I think the problem is in the functions.php that I set up in the child theme folder.

What should the code be for the child theme to properly link?

Hi,

Please post a link to your website, so I can check.

Best Regards,
Csaba

The site is not LIVE to the public. I cannot give you a link.

This is the functions.php code:

<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
	wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) );
}

Is this correct?

Hi,

Better, please try to create a Child Theme using this plugin: https://wordpress.org/plugins/child-theme-configurator/

Best Regards,
Csaba

I want to get the code right as opposed to using a plug-in. Can you tell me if my functions.php is set up correctly?

<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
	wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) );
}

Do I need to call out to all 11 CSS files? The theme uses Bootstrap.

Hi,

You can use this code:

<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );

}
?>

and if that will not work, then use this on instead:

<?php
function theme_enqueue_styles() {

    $parent_style = 'parent-style';

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style )
    );
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
?>

For more information, please read the Child Theme setup guide in WordPress codex: https://codex.wordpress.org/Child_Themes

Best Regards,
Csaba