Skip to content

Instantly share code, notes, and snippets.

@keks55
Created October 3, 2017 08:56
Show Gist options
  • Select an option

  • Save keks55/21c8cd379b91ebaf8b3c3191359dbb82 to your computer and use it in GitHub Desktop.

Select an option

Save keks55/21c8cd379b91ebaf8b3c3191359dbb82 to your computer and use it in GitHub Desktop.
Wordpress enqueue scripts
// Theme constants paths
define( 'TD', get_template_directory() );
define( 'INC', TD . '/inc' );
define( 'LANGS', TD . '/languages' );
define( 'TD_URI', get_template_directory_uri() );
define( 'JS', TD_URI . '/js' );
define( 'CSS', TD_URI . '/css' );
define( 'WIDGETS', INC . '/widgets' );
// Theme scripts
function keksus_theme_scripts() {
// styles
wp_enqueue_style( 'style', TD_URI . '/style.css' );
wp_enqueue_style( 'mobile', CSS . '/mobile.css' );
wp_enqueue_style( 'flexslider', CSS . '/flexslider.css' );
wp_enqueue_style( 'ioicons', CSS . '/ionicons.min.css' );
wp_enqueue_style( 'faicons', CSS . '/font-awesome.min.css' );
// scripts
wp_deregister_script('jquery');
wp_enqueue_script( 'jquery1.1.2', JS . '/jquery.js' );
wp_enqueue_script( 'main', JS . '/main.js' );
wp_enqueue_script( 'flexslider', JS . '/jquery.flexslider.js' );
}
add_action( 'wp_enqueue_scripts', 'keksus_theme_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment