bre_scripts_styles

Enqueues scripts and styles for front-end.

Description

bre_scripts_styles(); 

Usage

  1. if ( !function_exists( 'bre_scripts_styles' ) ) { 
  2. require_once '/functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bre_scripts_styles(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/functions.php  
  1. function bre_scripts_styles() { 
  2. global $wp_styles; 
  3.  
  4.  
  5. // Loads Bootstrap CSS 
  6. wp_register_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css', null, null, null); 
  7. wp_enqueue_style('bootstrap'); 
  8.  
  9. // Loads TheCartPress loop CSS 
  10. wp_register_style( 'tcp-loop', get_template_directory_uri() . '/css/tcp_loop.css'); 
  11. wp_enqueue_style('tcp-loop'); 
  12.  
  13. /** 
  14. * Loads our main stylesheet. 
  15. */ 
  16. wp_enqueue_style( 'bre-style', get_stylesheet_uri() ); 
  17.  
  18. /** 
  19. * Loads the Internet Explorer specific stylesheet. 
  20. */ 
  21. wp_enqueue_style( 'bre-ie', get_template_directory_uri() . '/css/ie.css', array( 'bre-style' ), '20121010' ); 
  22. $wp_styles->add_data( 'bre-ie', 'conditional', 'lt IE 9' ); 
  23.  
  24.  
  25. /** 
  26. * Adds JavaScript to pages with the comment form to support 
  27. * sites with threaded comments (when in use). 
  28. */ 
  29. if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) 
  30. wp_enqueue_script( 'comment-reply' ); 
  31.  
  32. wp_enqueue_script( 'jquery' ); 
  33.  
  34. wp_enqueue_script('respond', get_template_directory_uri() . '/js/respond.min.js', array( 'jquery' ), '1.0', true ); 
  35. wp_enqueue_script('bootstrap', get_template_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ), '1.0', true ); 
  36. wp_enqueue_script('tcp-bootstrap', get_template_directory_uri() . '/js/bre-bootstrap.js', array( 'jquery' ), '1.0', true ); 
  37.  
  38. /** 
  39. * Loads our special font CSS file. 
  40. * The use of Open Sans by default is localized. For languages that use 
  41. * characters not supported by the font, the font can be disabled. 
  42. * To disable in a child theme, use wp_dequeue_style() 
  43. * function mytheme_dequeue_fonts() { 
  44. * wp_dequeue_style( 'bre-fonts' ); 
  45. * } 
  46. * add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 ); 
  47. */ 
  48.  
  49. /** translators: If there are characters in your language that are not supported 
  50. by Open Sans, translate this to 'off'. Do not translate into your own language. */ 
  51. if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'bre-bootstrap-ecommerce' ) ) { 
  52. $subsets = 'latin, latin-ext'; 
  53.  
  54. /** translators: To add an additional Open Sans character subset specific to your language, translate 
  55. this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */ 
  56. $subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'bre-bootstrap-ecommerce' ); 
  57.  
  58. if ( 'cyrillic' == $subset ) 
  59. $subsets .= ', cyrillic, cyrillic-ext'; 
  60. elseif ( 'greek' == $subset ) 
  61. $subsets .= ', greek, greek-ext'; 
  62. elseif ( 'vietnamese' == $subset ) 
  63. $subsets .= ', vietnamese'; 
  64.  
  65. $protocol = is_ssl() ? 'https' : 'http'; 
  66. $query_args = array( 
  67. 'family' => 'Open+Sans:400italic, 700italic, 400, 600, 700',  
  68. 'subset' => $subsets,  
  69. ); 
  70. wp_enqueue_style( 'bre-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ), array(), null ); 
  71.  
  72.