Skip to content

Instantly share code, notes, and snippets.

@amitkolloldey
Last active March 21, 2017 19:28
Show Gist options
  • Save amitkolloldey/1942f500aba08b37af4b47ef1c5fa5de to your computer and use it in GitHub Desktop.
Save amitkolloldey/1942f500aba08b37af4b47ef1c5fa5de to your computer and use it in GitHub Desktop.
Enqueue Scripts And Styles In Wordpress
<?php
/**
* Enqueue scripts and styles.
*/
function balihomes_scripts() {
wp_enqueue_style( 'balihomes-fontawesomestyle', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
wp_enqueue_style( 'balihomes-bootstrapstyle', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css');
wp_enqueue_style( 'balihomes-style', get_stylesheet_uri() );
wp_enqueue_style( 'balihomes-stylemain', get_template_directory_uri() . '/css/style.css');
wp_enqueue_style( 'balihomes-responsive', get_template_directory_uri() . '/css/responsive.css');
wp_enqueue_style( 'balihomes-Roboto', 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Slabo+27px');
wp_enqueue_script( 'balihomes-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20951215', true );
wp_enqueue_script( 'balihomes-modernizr', get_template_directory_uri() . '/js/vendor/modernizr-2.8.3.min.js', array(), '20961215', false );
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'balihomes-ui','//code.jquery.com/ui/1.12.1/jquery-ui.js', array(), '209961211', true );
wp_enqueue_script( 'balihomes-mainjs', get_template_directory_uri() . '/js/main.js', array(), '209961215', true );
wp_enqueue_script( 'balihomes-bxsliderjs', get_template_directory_uri() . '/js/jquery.bxslider.min.js', array(), '209961216', true );
wp_enqueue_script( 'balihomes-bootstrapcdnjs', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js', array(), '209971217', true );
wp_enqueue_script( 'balihomes-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20151215', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'balihomes_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment