1

I have some trouble to configure and setup my wordpress child theme.

I buy a themes and when I try to do a child. I think the child function is never trigged also, the override files not work too.

Tree folder:

tree folder description here

My theme is activated.

style.CSS:

/*
Theme Name:   Kidslife Child
Theme URI:    http://localhost/child/
Description:  Kidslife Child Theme
Author:       localhost
Author URI:   http://localhost
Template:     kidslife
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  kidslife-child
*/
@charset "utf-8";
/* CSS Document */

@import url("../kidslife/style.css");

I try to use this function.php:

function.php

but the wp_die is never triggered.

Also, in the Tree folder, I add the custom.js (in the same folder/name as the parent) and he is never loaded.

What I do wrong?

Thanks

1

The name of the file must be functions.php in plural form not function.php

  • true. functions.php works now. But the custom.js is never triggered – Jean-philippe Emond Aug 3 '16 at 15:40
  • That because of you are calling get_template_directory_uri() instead of get_stylesheet_directory_uri(). Read codex.wordpress.org/Function_Reference/… – guido Aug 3 '16 at 15:44
  • Try wp_enqueue_script('custom-script', get_stylesheet_directory_uri() . '/js/public/custom.js', array(), '', true ); // Enqueue in footer, also empty short array initialization may cause errors. – guido Aug 3 '16 at 15:49
  • sorry for the delay. I tried. it not work. it load the Parent and mine not appear. even if I put like: wp_dequeue_script('custom-script'); before with an add_action with priority 5 or 70.. – Jean-philippe Emond Aug 3 '16 at 16:00
  • Use a different handler for your script. The dequeue may not work because of the child functions.php is loaded before the parent one. Also, the priority is inverse, minor number take precedence, so if you want to dequeue a script you should use a lower priority, try 20, 40, 50 I don't know which one the parent use. – guido Aug 3 '16 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.