Guest User

Untitled

a guest
Oct 20th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. //wp style in functions.php
  2. <?php wp_register_style( $handle, $src, $deps, $ver, $media ); ?>
  3. <?php
  4. function newsfeed_styles()
  5. {
  6. // Register the style like this for a theme:
  7. wp_register_style( 'newsfeed_bootstrapmin', get_template_directory_uri() . '/bootstrap.min.css',array(),'3.0.1','all' );
  8. // For either a plugin or a theme, you can then enqueue the style:
  9. wp_enqueue_style( 'newsfeed_bootstrapmin' );
  10. }
  11. add_action( 'wp_enqueue_scripts', 'newsfeed_styles' );
  12. ?>
  13. wp_register_script( string $handle, string $src, array $deps = array(), string|bool|null $ver = false, bool $in_footer = false )
  14. <?php
  15. //wp enqueue sctipt in functions.php
  16. function functionNameHere(){
  17. wp_deregister_script('jquery');
  18. wp_register_script( 'newsfeed_bootstrapjs', get_template_directory_uri() . '/assets/js/bootstrap.min.js', false, null, true );
  19.  
  20. wp_enqueue_script( 'newsfeed_bootstrapjs' );
  21. }
  22. add_action('wp_enqueue_scripts','functionNameHere');
  23. ?>
  24. //others way
  25.  
  26. <?php
  27.  
  28.  
  29. //wp_register_script( string $handle, string $src, array $deps = array(), string|bool|null $ver = false, bool $in_footer = false )
  30.  
  31. function functionNameHere(){
  32. wp_enqueue_script('jquery');
  33. wp_enqueue_script('easing-js',get_template_directory_uri().'/.easing.1.3.js',array(),'1.3',true);
  34.  
  35. wp_enqueue_script( 'easing-js' );
  36. }
  37. add_action('wp_enqueue_scripts','functionNameHere');
  38. ?>
Add Comment
Please, Sign In to add comment