Example #1
0
?>
assets/css/colorbox.css"/>
    <link rel="stylesheet" href="<?php 
echo YITH_WOOCOMPARE_URL;
?>
assets/css/jquery.dataTables.css"/>

    <?php 
wp_head();
?>

    <?php 
if (function_exists('YIT_Asset')) {
    ?>
        <?php 
    $assets = YIT_Asset()->get();
    ?>
        <link rel='stylesheet' id='google-fonts-css' href="<?php 
    echo $assets["style"]["google-fonts"]["src"];
    ?>
?ver=3.9" type="text/css" media="all">
        <link rel='stylesheet' id='cache-dynamics-css'  href='<?php 
    echo $assets["style"]["cache-dynamics"]["src"];
    ?>
?ver=3.9' type='text/css' media='all' />
        <link rel='stylesheet' id='font-awesome-css'  href='<?php 
    echo $assets["style"]["font-awesome"]["src"];
    ?>
?ver=3.9' type='text/css' media='all' />
    <?php 
}
Example #2
0
 /**
  * Enqueues style.
  *
  * Registers the style if src provided (does NOT overwrite) and enqueues.
  *
  * @since  2.0.0
  * @author Simone D'Amico <*****@*****.**>
  * @see    yit_register_style() For parameter information.
  */
 function yit_enqueue_style($handle, $src, $deps = array(), $ver = false, $media = 'all')
 {
     if (function_exists('YIT_Asset')) {
         $enqueue = true;
         $who = YIT_Asset()->get_stylesheet_handle(get_stylesheet_uri(), 'style');
         $where = 'before';
         if (false == $who) {
             $who = '';
         }
         YIT_Asset()->set('style', $handle, compact('src', 'deps', 'ver', 'media', 'enqueue'), $where, $who);
     } else {
         wp_enqueue_style($handle, $src, $deps, $ver, $media);
     }
 }
 /**
  * Add Testimonail Slider Script
  *
  * @since  2.0.0
  * @author Andrea Grillo <*****@*****.**>
  */
 function yit_add_testimonial_slider_script()
 {
     if (function_exists('YIT_Testimonial')) {
         $options = array('src' => YIT_THEME_ASSETS_URL . '/js/yit-testimonial-frontend.js', 'enqueue' => true, 'deps' => array('jquery'));
         if (function_exists('YIT_Asset') && !is_admin()) {
             YIT_Asset()->set('script', 'yit-testimonial', $options);
         } else {
             wp_dequeue_script('yit-testimonial');
         }
     }
 }
Example #4
0
 /**
  * Add stylesheet in assets for portfolio
  *
  * @return void
  * @since 2.0.0
  * @author Antonio La Rocca <*****@*****.**>
  */
 function yit_add_portfolio_stylesheet()
 {
     $page_slider = array('src' => YIT_THEME_ASSETS_URL . '/css/page-slider.css', 'enqueue' => true, 'registered' => false);
     YIT_Asset()->set('style', 'page-slider', $page_slider);
 }
Example #5
0
 /**
  * Enqueue stylesheets with wp_enqueue_style
  *
  * @return void
  * @access public
  * @since  1.0.0
  * @author Andrea Grillo <*****@*****.**>
  * @author Antonino Scarfi <*****@*****.**>
  */
 public function enqueue()
 {
     $subsets = yit_get_option('google_fonts_subsets', '');
     $subsets = !empty($subsets) ? 'subset=' . implode(',', array_shift($subsets)) . '&' : '';
     $base_url = '//fonts.googleapis.com/css?' . $subsets . 'family=';
     $i = 0;
     $srcs = array($base_url);
     $font_variations = '';
     $variations = '';
     $this->fonts = $this->getModel('font')->load_options_font();
     if (yit_ie_version() > 8 || yit_ie_version() == -1) {
         //IE9 or greater and other browser
         foreach ($this->fonts as $font => $style) {
             $variations = '';
             foreach ($style as $key => $variation) {
                 $variations .= $variation . ',';
             }
             $variations = substr($variations, 0, strlen($variations) - 1);
             if (strlen($srcs[$i] . $font . ':' . $variations) > 1024) {
                 $i++;
                 $srcs[$i] = $base_url;
             }
             if (!empty($font) && !empty($variations)) {
                 $srcs[$i] .= $font . ':' . $variations . '|';
             }
         }
         foreach ($srcs as $k => $src) {
             if ($src == $base_url) {
                 continue;
             }
             $index = count($srcs) > 1 ? '-' . ($k + 1) : '';
             $args = array('src' => rtrim(str_replace(' ', '+', $src), '|'), 'enqueue' => true);
             YIT_Asset()->set('style', 'google-fonts' . $index, $args);
         }
     } else {
         //IE8 Support
         foreach ($this->fonts as $font => $style) {
             $font_variations = '';
             $variations = '';
             foreach ($style as $key => $variation) {
                 $variations .= $variation . ',';
             }
             $variations = substr($variations, 0, strlen($variations) - 1);
             $font_variations .= $font . ':' . $variations;
             $args = array('src' => $base_url . str_replace(' ', '+', $font_variations), 'enqueue' => true);
             YIT_Asset()->set('style', sanitize_title($font), $args);
         }
     }
 }
Example #6
0
 /**
  * Enqueue dinamycs.css file
  *
  * @return void
  * @since 1.0.0
  * @access public
  * Andrea Grillo <*****@*****.**>
  */
 public function enqueue_dynamics_css()
 {
     if ($this->custom_file_exists()) {
         $args = array('src' => $this->getModel('cache')->locate_url($this->_getCustomFilename()), 'enqueue' => true);
         YIT_Asset()->set('style', 'cache-dynamics', $args);
     }
 }
Example #7
0
    function yit_add_wc_styles_to_assets(){

        $path = 'woocommerce';
        $version = WC()->version;

        if ( version_compare( preg_replace( '/-beta-([0-9]+)/', '', $version ), WC_LATEST_VERSION, '<' ) ) {
            $path = 'woocommerce_' . substr( $version, 0, 3 ) . '.x';
        }

        $stylepicker_css = array(
            'src'     => get_stylesheet_directory_uri() . '/' . $path . '/style.css',
            'enqueue'   => true,
            'media'     => 'all'
        );

        if( function_exists( 'YIT_Asset' ) ){
            YIT_Asset()->set( 'style', 'yit-woocommerce', $stylepicker_css, 'after', 'theme-stylesheet' );
        }

    }
Example #8
0
 function yit_prelaunch_dequeue_script_and_style()
 {
     if (function_exists('YIT_Asset') && class_exists('YITH_Prelaunch_Frontend')) {
         if (method_exists('YITH_Prelaunch_Frontend', 'userIsAllowed') && !YITH_Prelaunch_Frontend::userIsAllowed()) {
             $is_allowed = true;
         } else {
             $is_allowed = false;
             //super admin
             if (current_user_can('manage_network') || current_user_can('administrator')) {
                 $is_allowed = true;
             }
             $allowed = get_option('yith_prelaunch_roles');
             $user_roles = yit_user_roles();
             foreach ($user_roles as $role) {
                 if (in_array($role, $allowed)) {
                     $is_allowed = true;
                     break;
                 }
             }
         }
         if (!$is_allowed) {
             YIT_Asset()->dequeue_all('style');
             YIT_Asset()->dequeue_all('script');
         }
     }
 }
 function yit_add_wc_styles_to_assets()
 {
     $stylepicker_css = array('src' => get_stylesheet_directory_uri() . '/woocommerce/style.css', 'enqueue' => true, 'media' => 'all');
     if (function_exists('YIT_Asset')) {
         YIT_Asset()->set('style', 'yit-woocommerce', $stylepicker_css, 'after', 'theme-stylesheet');
     }
 }