child theme

wilczoglodna
Posts: 5
Joined: Sat May 07, 2016 11:09 pm
Contact:

child theme

Postby wilczoglodna » Thu Aug 04, 2016 5:42 pm Supported Until: Fri Sep 30 21:15:45 +1000 2016 | Expired

Hi,

how can I create a child theme for Royal? I need to do that, cause my custom-css is getting pretty big and it's slowing my website and taking to many resources.

In my child's style.css I tried to put the usual:
@import url("../Royal/style.css");

and/or
@import url("../Royal/css/style.css");

but it doesn't work and after activating the website looks broken. What should I import?

User avatar
pirateS
Site Admin
Posts: 6168
Joined: Wed Nov 05, 2014 11:49 am
Contact:

Re: child theme

Postby pirateS » Sat Aug 06, 2016 10:10 am

Hi there,
you should use wp_enqueue_style function. In functions.php ( you should create the file inside of Yourjourjey child theme folder, then put this code:

CodeColon Select All Code

add_action('wp_enqueue_scripts', 'wiloke_yn_childtheme');
function wiloke_yn_childtheme()
{
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/css/style.css' );
}


Return to “Royal”

Who is online

Users browsing this forum: No registered users and 1 guest