javascript - unable to add custom js script in child theme -


i need add custom script in child theme in wordpress.

this content of child theme :

themes       |meteorite     |style.css   |meteorite-child     |function.php     |style.css     |js       |mngclk.js 

my function.php

add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() {     wp_enqueue_style('parent-style', get_template_directory_uri() . '/style.css'); }  wp_register_script( 'new-script', get_stylesheet_directory_uri() . '/js/mngclk.js', 'jquery', "1", true);  wp_enqueue_script( 'new-script' ); 

i tried multiple change did not manage inclute custom js script

this proper example

function my_theme_enqueue_styles() {      $parent_style = 'parent-style'; // 'twentyfifteen-style' 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', 'my_theme_enqueue_styles' ); 

follow link more info

enter link description here


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -