Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //wp style in functions.php
- <?php wp_register_style( $handle, $src, $deps, $ver, $media ); ?>
- <?php
- function newsfeed_styles()
- {
- // Register the style like this for a theme:
- wp_register_style( 'newsfeed_bootstrapmin', get_template_directory_uri() . '/bootstrap.min.css',array(),'3.0.1','all' );
- // For either a plugin or a theme, you can then enqueue the style:
- wp_enqueue_style( 'newsfeed_bootstrapmin' );
- }
- add_action( 'wp_enqueue_scripts', 'newsfeed_styles' );
- ?>
- wp_register_script( string $handle, string $src, array $deps = array(), string|bool|null $ver = false, bool $in_footer = false )
- <?php
- //wp enqueue sctipt in functions.php
- function functionNameHere(){
- wp_deregister_script('jquery');
- wp_register_script( 'newsfeed_bootstrapjs', get_template_directory_uri() . '/assets/js/bootstrap.min.js', false, null, true );
- wp_enqueue_script( 'newsfeed_bootstrapjs' );
- }
- add_action('wp_enqueue_scripts','functionNameHere');
- ?>
- //others way
- <?php
- //wp_register_script( string $handle, string $src, array $deps = array(), string|bool|null $ver = false, bool $in_footer = false )
- function functionNameHere(){
- wp_enqueue_script('jquery');
- wp_enqueue_script('easing-js',get_template_directory_uri().'/.easing.1.3.js',array(),'1.3',true);
- wp_enqueue_script( 'easing-js' );
- }
- add_action('wp_enqueue_scripts','functionNameHere');
- ?>
Add Comment
Please, Sign In to add comment