Nyi Nyi Naing Nyi Nyi Naing - 1 year ago 84
CSS Question

How to add bootstrap css to my Wordpress plugin

I am developing a Wordpress plugin.

I would like to know how to integrate a Bootstrap CSS file into my plugin?

Answer Source

create a function in your Plugin file

function add_scripts_and_css(){
  wp_enqueue_style('your-plugin-bootrtrap_css',  plugin_dir_url( __FILE__ ) . 'folderpath/bootstrap.css');

add_action('wp_enqueue_scripts', 'add_scripts_and_css');

This is the way to add wp_enqueue_style to add css files and wp_enqueue_script to add JavaScript .js files.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download