Skip to content

Instantly share code, notes, and snippets.

@muzahedul03
Created February 27, 2017 05:30
Show Gist options
  • Save muzahedul03/8cea271f9496405ba3f156042ab1ed89 to your computer and use it in GitHub Desktop.
Save muzahedul03/8cea271f9496405ba3f156042ab1ed89 to your computer and use it in GitHub Desktop.
How Include CSS file in Wordpress using Function
<?php
//includes all felxo_theme_file_css
function flexo_theme_file(){
//inculde CSS file
wp_register_style('bootstrap', get_template_directory_uri(). '/css/bootstrap.min.css', array(), '3.1.0',all);
wp_register_style('fancybox', get_template_directory_uri(). '/css/fancybox/jquery.fancybox.css', array(), '3.1.0',all);
wp_register_style('jcarousel', get_template_directory_uri(). '/css/jcarousel.css', array(), '3.1.0',all);
wp_register_style('flexslider', get_template_directory_uri(). '/css/flexslider.css', array(), '3.1.0',all);
wp_register_style('style', get_template_directory_uri(). '/css/style.css', array(), '3.1.0',all);
wp_register_style('default', get_template_directory_uri(). '/skins/default.css', array(), '3.1.0',all);
wp_enqueue_style('bootstrap');
wp_enqueue_style('fancybox');
wp_enqueue_style('jcarousel');
wp_enqueue_style('flexslider');
wp_enqueue_style('style');
wp_enqueue_style('default');
}
add_action('wp_enqueue_scripts', 'flexo_theme_file');
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment