Child theme – enqueueing style sheet

Home Forums Business Key Child theme – enqueueing style sheet

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5430
    Anonymous
    Inactive

    Hi, I am quite new to WordPress and themes and am trying to set up a site using Business Key. I want to make child theme, and I understnad the point of it but some of the detail is confusing me.
    I found something explaining how to make a child theme and it says the stylesheets need to be enqueued, and gives this code to do that (in the child themes functions.php file).
    <?php
    function enqueue_parent_styles() {

    $parent_style = ‘parent-style’; // This is ‘twentyfifteen-style’ for the Twenty Fifteen theme.

    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’, ‘enqueue_parent_styles’ );
    ?>

    Thing is, I can’t find anywhere in Business Key that the main style is enqueued, and the code above says use the same name in the child theme as the parent theme does. Can you help please?

    I did find some other themes (e.g. WooCommerce) that seem to say that none of this enqueueing is needed as the main theme handles it all in another way. Does this apply to Business Key?

    I would appreciate a couple of pointers to get me started – thanks.

    #5466
    Axle Support
    Moderator

    Hi @JohnF

    We have recently released child theme of Business Key.

    Please download it from here and check how we have created child theme.

    #5481
    Anonymous
    Inactive

    That’s excellent, thanks very much for your help.

    #5483
    Axle Support
    Moderator

    Hi @johnf

    You are welcome.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.