WP .js script file not loading

According to codex, get_stylesheet_directory_uri() does not including a trailing slash. So, you might want to use it in the following way: function wpb_adding_scripts() { wp_register_script(‘my_scripts’, get_stylesheet_directory_uri().’/js/scripts.js’, array(‘jquery’),’1.1′, true); wp_enqueue_script(‘my_scripts’); } add_action( ‘wp_enqueue_scripts’, ‘wpb_adding_scripts’ ); UPDATE If you want to use jQuery in your scripts, you should do it in one of these ways: Use jQuery … Read more

Priority loading file css in child theme

I assume it needs to be loaded last because it depends on other stylesheets files. In that case, the recommended way to do this in WordPress is to use the “dependencies” parameter in wp_enqueue_style. Set up the dependencies wp_enqueue_style accepts an array of the handles for the stylesheets that your stylesheet depends on, e.g. $dependencies … Read more

How to Edit the style of header title of Twenty Eleven Theme?

The CSS rule that is setting the color of the site title, which you referred to being on line #58 of index.php (which is actually shown as line #60 in your screenshot), I think, is generated from the WordPress customizer – Appearance -> Customize from within your admin area. The Chrome element inspector isn’t referring … Read more

Child theme undefined variable error

In this line you use variable called $parent_style wp_enqueue_style(‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array($parent_style)); but you donโ€™t define such variable anywhere in your code. Most probably you want to use the slug of parent style instead: wp_enqueue_style(‘child-style’, get_stylesheet_directory_uri() . ‘/style.css’, array(‘parent-style’));

Which action is triggered when a theme was modified?

Anytime changes are saved in the Customizer, there is a customize_save_after hook. For theme updates, you can use the upgrader_process_complete hook – you pass it various arguments including ‘type’ => ‘theme’. I don’t think there are any WordPress-specific hooks for when files of a child theme are modified. This typically happens via FTP, rather than … Read more