Support » Theme: VW Corporate Lite » Errors when creating my child theme

  • Resolved Thalie_Lili

    (@thalie_lili)


    Please I need help,
    I read all the forums about creating a child theme from an unmodified parent theme before starting my edits. Those are the articles that helped m ewiththe first steps but it is not successfull (https://codex.wordpress.org/Child_Themes#Creating_a_Child_Theme_from_an_Unmodified_Parent_Theme) (https://wordpress.stackexchange.com/questions/195376/how-to-correctly-enqueue-the-parent-and-child-theme-stylesheets-in-the-creation).

    The parent theme that I use is vw-corporate-lite
    I created the child theme vw-corporate-lite-child

    1) This is the code I put under the style.css (I created under my child theme):

    /*
     Theme Name:   VW Corporate Lite Child
     Theme URI:    https://www.vwthemes.com/free/wp-corporate-child/
     Description:  VW Corporate Lite Child Theme
     Author:       VWthemes
     Author URI:   https://www.vwthemes.com/
     Template:     VW Corporate Lite
     Version:      1.5.3.1
     License:      GNU General Public License
     License URI:  license.txt
     Tags:         left-sidebar,right-sidebar,one-column,two-columns,three-columns,four-columns,grid-layout,custom-colors,custom-background,custom-logo,custom-menu,custom-header,editor-style,featured-images,footer-widgets,sticky-post,buddypress,full-width-template,theme-options,translation-ready,threaded-comments,rtl-language-support,blog,news,portfolio,e-commerce
     Text Domain:  vw-corporate-lite-child
    */

    2) This is the code I put under the functions.php (I created under my child theme):

    <?php
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() {
     
        $parent_style = 'vw-corporate-lite-style'; // This is 'vw-corporate-lite-style' for the VW Corporate Lite.
     
        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 ),
            wp_get_theme()->get('Version')
        );
    }
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent', get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( 'custom-handler-one', get_template_directory_uri() . '/rtl.css' );
        wp_enqueue_style( 'custom-handler-two', get_template_directory_uri() . '/bootstrap.css' );
        wp_enqueue_style( 'custom-handler-three', get_template_directory_uri() . '/custom.css' );
        wp_enqueue_style( 'custom-handler-four', get_template_directory_uri() . '/customize-controls.css' );
        wp_enqueue_style( 'custom-handler-five', get_template_directory_uri() . '/editor-style.css' );
        wp_enqueue_style( 'custom-handler-six', get_template_directory_uri() . '/font-awesome.css' );
        wp_enqueue_style( 'custom-handler-seven', get_template_directory_uri() . '/ie.css' );
        wp_enqueue_style( 'custom-handler-eight', get_template_directory_uri() . '/nivo-slider.css' );
    }
    
    ?>

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

    Can you tell me what is my error!?
    I tried to follow all the instructions from the previous articles.
    For your information, my parent theme has style.css and rtl.css, plus a CSS DIRECTORY with: bootstrap.css, custom.css, editor-style.css, customize-controls.css, editor-style.css, font-awesome.css, ie.css, nivo-slider.css

    Thanks in advance for your precious help!

    • This topic was modified 2 years, 8 months ago by bdbrown.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Theme Author VW THEMES

    (@vowelweb)

    Greetings,

    Step 1. Create the new folder name as “vw-corporate-lite-child”, then add the new file name as “style.css”.

    Step 2. Add the below Theme Info in style.css file.

    /*
    Theme Name: VW Corporate Lite Child
    Theme URI: https://www.vwthemes.com/free/wp-corporate-wordpress-theme/
    Author: VWthemes
    Author URI: https://www.vwthemes.com/
    Description: VW Corporate Lite Child Theme
    Version: 0.1
    license : GNU General Public License v3.0
    License URI : http://www.gnu.org/licenses/gpl.html
    Text Domain: vw-corporate-lite-child
    Template: vw-corporate-lite
    Tags: left-sidebar, right-sidebar, one-column, two-columns, three-columns, four-columns, grid-layout, custom-colors, custom-background, custom-logo, custom-menu, custom-header, editor-style, featured-images, footer-widgets, sticky-post, full-width-template, theme-options, translation-ready, rtl-language-support, threaded-comments, front-page-post-form, blog, portfolio, news
    */

    Step 3. Add new file name as “function.php”, then paste the below code.

    <?php

    add_action( ‘wp_enqueue_scripts’, ‘vw_corporate_lite_child_enqueue_styles’ );
    function vw_corporate_lite_child_enqueue_styles() {
    $parent_style = ‘vw-corporate-lite-style’; // Style handle of parent theme.
    wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ );
    wp_enqueue_style( ‘vw-corporate-lite-style’, get_stylesheet_uri(), array( $parent_style ) );
    }

    ?>

    Thanks…

Viewing 1 replies (of 1 total)
  • The topic ‘Errors when creating my child theme’ is closed to new replies.