Description
A safe way to register a CSS style file for later use with wp_enqueue_style().
Create folder of assets in your themes and add your custom css and js.
Please below code in function.php of your themes
<pre>// Register style sheet.
add_action( 'wp_enqueue_scripts', 'custom_register_plugin_styles' );
function custom_register_plugin_styles() {
/**
* Register style sheet.
*/
wp_register_style( 'my-style', get_template_directory_uri() .'/assets/custom_css.css' );
wp_enqueue_style( 'my-style' );
/**
* enqueue style sheet and js
*/
wp_enqueue_style( 'main_css', get_template_directory_uri() . '/assets/custom_style.css' );
wp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/assets/bootstrap.js', array('jquery'), '', true );
}
</pre>
No comments:
Post a Comment