Archived

This topic is now archived and is closed to further replies.

  • 0

Resolved add css files from a child theme


Question

Posted · Report post

hi,

i'm trying to add some CSS, JS files to my child theme, this is my code:


add_action('wp_enqueue_scripts', 'my_add_styles');

add_action('wp_enqueue_scripts', 'my_add_scripts');

function my_add_styles() {

  wp_enqueue_style('normalize',get_template_directory_uri().'/css/normalize.css');

  wp_enqueue_style('sans-pro', 'http://fonts.googleapis.com/css?family=Source+Sans+Pro:300');

  wp_enqueue_style('main', get_template_directory_uri().'/css/main.css');

}

function my_add_scripts() {

  wp_enqueue_script('modernizer', get_template_directory_uri().'/js/vendor/modernizr-2.6.1.min.js',array(), '2.6.1', false);

  wp_enqueue_script('jquery','//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js',array('jquery'), '1.8.0', true);

  wp_enqueue_script('plugins',get_template_directory_uri().'/js/plugins.js',array('jquery'), '1.0', true);

  wp_enqueue_script('main',get_template_directory_uri().'/js/main.js',array('jquery'), '1.0', true);

}

but the get_template_directory_uri() point to the pageline parent folder, how can i point to my child template folder?

regards

Share this post


Link to post
Share on other sites

3 answers to this question

Posted · Report post

The topic was marked as resolved.

Share this post


Link to post
Share on other sites