• Resolved bmulu

    (@rmulugeta)


    I am new to wordpress and wondering if you can help?
    I have created child theme for twentysixteen and when I view child page, the page displays but no style at all!!

    child style.css as follows

    Theme Name: Twenty Sixteen child
    Theme URI: http://www.mysite.com/
    Author: xxxx
    Author URI: http://www.mysite.com/
    Template: twentysixteen
    Description: Twenty Sixteen Child Theme
    Version: 1.2
    License: GNU General Public License v2 or later
    License URI: http://www.gnu.org/licenses/gpl-2.0.html
    Tags: black, blue, gray, red, white, threaded-comments, translation-ready
    Text Domain: twentysixteen-child

    Can anyone enlighten me where I’ve gone wrong please?

Viewing 7 replies - 1 through 7 (of 7 total)
  • TheSupercargo

    (@thesupercargo)

    Hi @bmulu.

    Have you remembered to enqueue the parent and child theme stylesheets?

    Does your child theme folder also contain a functions.php file?

    According to the WP Codex:
    “The only required child theme file is style.css, but functions.php is necessary to enqueue styles correctly”

    http://codex.wordpress.org/Child_Themes

    Apologies if you’ve done all that and you are still in difficulties, but I thought it best to check the fundamentals. Don’t know how long it took me to work out when I was first learning about child themes that I did need a functions.php despite the Codex seeming to suggest it was optional.

    Courage!

    Thread Starter bmulu

    (@rmulugeta)

    Hi Supercargo and thanks for getting back to me

    enqueue the parent and child theme stylesheets?
    I have tried different enqueues and here is copy of function on child theme at present

    <?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_directory_uri() . ‘/style.css’,
    array(‘parent-style’)
    );

    }

    stephencottontail

    (@stephencottontail)

    Your code looks fine. Can you post a link to your site with the child theme active?

    Thread Starter bmulu

    (@rmulugeta)

    thanks stephencottontail and here is link
    http://www.vol-cloud.co.uk/

    stephencottontail

    (@stephencottontail)

    It’s strange that your site isn’t even trying to load the parent theme’s stylesheet. Can you double-check your child theme’s functions.php file? Perhaps the updated file didn’t get uploaded properly the first time. Can you also verify that the file is named “functions” (plural)?

    Thread Starter bmulu

    (@rmulugeta)

    omg you are a life saver!! functions were spelled function

    Thank you so mutch stephencottontail.

    TheSupercargo

    (@thesupercargo)

    Thumbs up to @stephencottontail!
    🙂

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘child-theme not overriding parent style.css’ is closed to new replies.