• Resolved pamperurselfgreen

    (@pamperurselfgreen)


    Hi, could someone help me with the code for a child theme. Here’s what I did and it didn’t show up on wordpress. Thanks!

    I created a bouquet-child folder in theme. and created a functions.php and posted this in

    <?php
    /**
    * Load the style sheet from the parent theme.
    *
    */
    function theme_name_parent_styles() {
    // Enqueue the parent stylesheet
    wp_enqueue_style( ‘theme-name-parent-style’, get_template_directory_uri() . ‘/style.css’, array(), ‘0.1’, ‘all’ );
    // Enqueue the parent rtl stylesheet
    if ( is_rtl() ) {
    wp_enqueue_style( ‘theme-name-parent-style-rtl’, get_template_directory_uri() . ‘/rtl.css’, array(), ‘0.1’, ‘all’ );
    }
    }
    add_action( ‘wp_enqueue_scripts’, ‘theme_name_parent_styles’ );
    ?>

    I copied the style.css from the bouquet theme and paste into the bouquet-child theme folder and changed the name

    /*
    Theme Name: bouquet child
    Theme URI: https://wordpress.com/themes/bouquet/
    Description: Bouquet is an elegant, simple theme inspired by the beauty found in flowers. Notable features include two floral schemes, a responsive layout structure that adapts to smaller devices, a right sidebar, a full-width template, support for post formats, custom background, and custom header.
    Version: 1.2.5
    Author: Automattic
    Author URI: https://wordpress.com/themes/
    License: GNU General Public License v2 or later
    License URI: https://www.gnu.org/licenses/gpl-2.0.html
    Tags: blue, orange, pink, white, light, one-column, two-columns, right-sidebar, custom-background, custom-header, custom-menu, full-width-template, post-formats, rtl-language-support, translation-ready, responsive-layout, photoblogging
    */

    /* =Reset default browser CSS. Based on work by Eric Meyer: https://meyerweb.com/eric/tools/css/reset/index.html
    ————————————————————– */

Viewing 4 replies - 1 through 4 (of 4 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Your child theme folder should live in the “themes/” folder and the top of the CSS comments should look like this example:

    /*
     Theme Name:   Twenty Fifteen Child
     Template:     twentyfifteen
    */

    Template is the name of parent theme folder

    Moderator Kathryn Presner

    (@zoonini)

    I copied the style.css from the bouquet theme and paste into the bouquet-child theme folder and changed the name

    This step is incorrect. You shouldn’t copy style.css from the parent into your child theme.

    You should instead create a blank file called style.css and at the top add the code that Andrew gave you above. In your case, the Theme Name would be Bouquet Child and the Template would be bouquet. The Template name is case-sensitive, so be sure bouquet is spelled all lowercase to match your parent’s folder name.

    You’d then only put any CSS in your child theme’s style.css that you want to override the parent theme. You don’t put all of the parent’s styles – only the pieces you want to change. For example, if you want to change the site title colour, you could add one bit of CSS to your child theme to do that.

    Here are some guides to child themes that might help:

    https://codex.www.ads-software.com/Child_Themes
    https://op111.net/53/
    https://vimeo.com/39023468

    I also gave a presentation on child themes that might be useful if you’d like to watch it:

    Let me know how it goes.

    Thread Starter pamperurselfgreen

    (@pamperurselfgreen)

    Kathryn, thank you for taking the time to explain it to me! It makes sense now ??

    Moderator Kathryn Presner

    (@zoonini)

    Wonderful! Let me know how it goes and if you get stuck again – I’m happy to help.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Creating a child theme for bouquet’ is closed to new replies.