Created
March 26, 2018 11:27
-
-
Save rushijagani/08be9eede59152bed79ae801a02099ee to your computer and use it in GitHub Desktop.
Level Creative Theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Level Creativ Theme functions and definitions | |
* | |
* @link https://developer.wordpress.org/themes/basics/theme-functions/ | |
* | |
* @package Level Creativ | |
* @since 1.0.0 | |
*/ | |
/** | |
* Define Constants | |
*/ | |
define('CHILD_THEME_LEVEL_CREATIV_VERSION', '1.0.0'); | |
/** | |
* Enqueue styles | |
*/ | |
function child_enqueue_styles() { | |
wp_enqueue_style('level-creativ-theme-css', get_stylesheet_directory_uri() . '/style.css', array( | |
'astra-theme-css' | |
), CHILD_THEME_LEVEL_CREATIV_VERSION, 'all'); | |
} | |
add_action('wp_enqueue_scripts', 'child_enqueue_styles', 15); | |
add_action( 'after_setup_theme', 'lvl_creativ_theme_setup' ); | |
// THEME SETUP | |
if (!function_exists('lvl_creativ_theme_setup')): | |
/** | |
* Sets up theme defaults and registers support for various WordPress features. | |
* | |
* Note that this function is hooked into the after_setup_theme hook, which | |
* runs before the init hook. The init hook is too late for some features, such | |
* as indicating support for post thumbnails. | |
*/ | |
function lvl_creativ_theme_setup() { | |
/* | |
* Make theme available for translation. | |
* Translations can be filed in the /languages/ directory. | |
* If you're building a theme based on level-creativ, use a find and replace | |
* to change 'level-creativ' to the name of your theme in all the template files. | |
*/ | |
load_child_theme_textdomain('level-creativ', get_stylesheet_directory() . '/languages'); | |
} | |
endif; | |
// Load jsfiles on the 'wp_enqueue_scripts' action hook. | |
add_action('wp_enqueue_scripts', 'lvl_creativ_load_scripts'); | |
// add_filter('child_add_scripts', 'lvl_creativ_load_scripts'); | |
// LOAD SCRIPTS | |
function lvl_creativ_load_scripts() { | |
wp_enqueue_script( 'lvl_creativ_adroll_pixel', // name of script registered with WordPress | |
esc_url( __( get_stylesheet_directory_uri(), 'level-creativ' ) ) . '/assets/js/lib/adroll-pixel.js', // location of script - use get_template_directory_uri to provide path | |
array( | |
'jquery' | |
), // array of registered script handles this script depends on | |
'1.0.0', // version number | |
true // to load script in footer, set to true | |
); | |
} // END lvl_creativ_load_script() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment