Creating a child theme in WordPress

Create a new directory with any appropriate name in the themes folder and inside create two new files: functions.php & style.css

style.css
/*
Theme Name:   <Your-Name> Child Theme
Theme URI:    https://jkristoffer.com
Description:  Child theme, based on <Parent> Theme
Author:       Kristoffer
Author URI:   https://jkristoffer.com
Template:     <parent-theme-directory-name>
*/

It’s important to note that the value of Template field should be the folder name of the Parent theme

functions.php
<?php
  # functions.php
  # Inherits parent theme's CSS
  add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );

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

Adding custom scripts / css to WordPress

Basic

wp_enqueue_script
wp_enqueue_style

wp_enqueue_script($jsref, $pathToJSFile, $dep, $ver, $in_footer);
wp_enqueue_style($jsref, $pathToCSSFile );

# example from the theme directory
wp_enqueue_script('home', get_stylesheet_directory_uri() . '/js/home.js', array('jquery'), '', true);

# example from a plugin directory
wp_enqueue_style( 'plugin_style', plugins_url('myplugin.css', __FILE__) );

Admin/Frontend

admin_enqueue_scripts – admin backend
wp_enqueue_scripts – frontend

add_action( 'admin_enqueue_scripts', function(){
    wp_enqueue_script(...);
    wp_enqueue_style(...);
});

Enqueuing Scripts from CDN

wp_enqueue_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/5.4.0/css/font-awesome.min.css');
wp_enqueue_script( 'Slick', 'https://cdn.jsdelivr.net/jquery.slick/1.5.9/slick.min.js', null, null, true );