示例#1
0
    /**
     * Print the html for mobile devices favicons.
     *
     * @return string
     * @author Andrea Frascaspata    <*****@*****.**>
     * @since 1.0.0
     */
    function yit_print_mobile_favicons() {

        // 144: For iPad3 with retina display:
        // 114: for first- and second-generation iPad
        //  72: For first- and second-generation iPad
        //  57: For non-Retina iPhone, iPod Touch, and Android 2.1+ devices

        $size_list = array(144,114,72,57);

        $favicon_base_url =  yit_get_option( 'general-favicon-touch' );

        //yit default favicons
        if ( $favicon_base_url===false || empty( $favicon_base_url ) || $favicon_base_url == get_template_directory_uri() . '/apple-touch-icon-144x.png' ) {

            foreach ( $size_list as $size ) {
                $favicon_url = yit_remove_protocol_url( get_template_directory_uri() . '/apple-touch-icon-' . $size . 'x.png' );
                echo '<link rel="apple-touch-icon-precomposed" sizes="' . $size . 'x' . $size . '" href="' . $favicon_url . '" />';
            }

        }
        //custom favicon
        else {

            foreach ( $size_list as $size ) {

                $size_name = 'favicon_' . $size;

                add_image_size( $size_name, $size, $size, true );

                $args['src']  = $favicon_base_url;
                $args['output'] = 'url';
                $args['size'] = $size_name;

                $url = yit_remove_protocol_url( yit_image( $args, false ) ) ;

                echo '<link rel="apple-touch-icon-precomposed" sizes="' . $size . 'x' . $size . '" href="' . $url . '" />';
            }

        }

    }
示例#2
0
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */

$yit_core_assets_url = yit_remove_protocol_url(YIT_CORE_ASSETS_URL);
$yit_theme_template_direcory_uri = yit_remove_protocol_url(YIT_THEME_TEMPLATES_URL);
$get_template_directory_uri = yit_remove_protocol_url(get_template_directory_uri());
$get_stylesheet_directory = yit_remove_protocol_url(get_stylesheet_directory());

$stylesheet_url = yit_remove_protocol_url( yit_get_bloginfo( 'stylesheet_url' ) );

$ping_back_url =  yit_remove_protocol_url( yit_get_bloginfo( 'pingback_url' ) );

$rss2_url = yit_remove_protocol_url( yit_get_bloginfo( 'rss2_url' ) );
$comments_rss2_url = yit_remove_protocol_url( yit_get_bloginfo( 'comments_rss2_url' ) );

yit_meta_tags() ?>

<title><?php yit_title() ?></title>

<?php /*
<!-- RESET STYLESHEET -->
<link rel="stylesheet" type="text/css" media="all" href="<?php echo YIT_THEME_CSS_URL . '/reset.css'; ?>" />
*/ ?>

<!-- BOOTSTRAP STYLESHEET -->
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $yit_core_assets_url . '/css/reset-bootstrap.css'; ?>" />
<!-- MAIN THEME STYLESHEET -->
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $stylesheet_url; ?>" />
示例#3
0
	/**
	 * Add shortcodes style
	 * 
	 */
	public function add_widgets_css_js() {
	  	if( file_exists(YIT_THEME_FUNC_DIR . '/assets/js/widgets.js') ) {
            wp_enqueue_script( 'widgets_theme_js', yit_remove_protocol_url( get_template_directory_uri() ) . '/theme/assets/js/widgets.js', array( 'jquery' ), '', true );
	  	}
	 }
示例#4
0
function yit_enqueue_woocommerce_2_3_assets()
{
    wp_enqueue_script('yit-woocommerce-2-3', yit_remove_protocol_url(YIT_THEME_ASSETS_URL) . '/js/woocommerce_2.3.js', array('jquery', 'jquery-cookie'), '1.0', true);
}
示例#5
0
	/**
	 * Add shortcodes style
	 * 
	 */
	public function add_shortcodes_css_js() {

        $get_template_directory_uri = yit_remove_protocol_url(get_template_directory_uri() );

        $url = get_template_directory_uri() . '/core/assets/css/shortcodes.css';
	    yit_enqueue_style(1200,'shortcodes_css', $url);

        wp_enqueue_script('shortcode_twitter', $get_template_directory_uri . '/core/assets/js/twitter-text.js', array('jquery'), '', true );
	    //yit_enqueue_style(1200,'shortcode_twitter');
	  
	    //yit_enqueue_style(1200,'shortcode_tipsy_css', get_template_directory_uri() . '/core/assets/css/tipsy.css', array('jquery'), '', true );
	    //wp_enqueue_script('shortcode_tipsy_js', get_template_directory_uri() . '/core/assets/js/jquery.tipsy.js', array('jquery'), '', true );
	    //yit_enqueue_style(1200,'shortcode_tipsy_js');
	  
	    wp_enqueue_script('shortcode_cycle_js', $get_template_directory_uri . '/core/assets/js/jquery.cycle.min.js', array('jquery'), '', true );
  	    //yit_enqueue_style(1200,'shortcodes_cycle_js');
	  
	    wp_enqueue_script('shortcode_js', $get_template_directory_uri . '/core/assets/js/shortcodes.js', array('jquery'), '', true );
	    //yit_enqueue_style(1200,'shortcodes_js');

	  	if( file_exists(YIT_THEME_FUNC_DIR . '/assets/js/shortcodes.js') ) {
	    	wp_enqueue_script('shortcode_theme_js', $get_template_directory_uri . '/theme/assets/js/shortcodes.js', array('jquery'), '', true );
	  	}
	 }
示例#6
0
文件: Css.php 项目: simonsays88/costa
    /**
	 * Enqueue stylesheets with wp_enqueue_style
	 * 
	 * @return void
	 * @since 1.0.0
	 */
	public function enqueue() {
		usort( $this->_stylesheets, array( $this, 'sortByPriority' ) );
		
		$excludedStylesheets = array();
		
		foreach( $this->_stylesheets as $s ) {
			extract($s);
			
			if( $type == 'external' ) {
				wp_enqueue_style( $handle, $src, $deps, $ver, $media );
			} elseif( $type == 'yit' ) {
				if( !$exclude && ($media == 'all' || $media == 'screen') ) {
					//wp_enqueue_style( $handle, $src, $deps, $ver, $media );
					$filename = str_replace( get_template_directory_uri(), get_template_directory(), $src);
					$style = "";
					if( file_exists( $filename ) ) {
						$style = file_get_contents($filename);
					}
					$this->_style .= "/* {$handle} - {$src} */\n" . $this->replacePath($src, $style) . "\n\n";
				} elseif( !$exclude ) {
					wp_enqueue_style( $handle, $src, $deps, $ver, $media );
				} else {
					$excludedStylesheets[] = $s;
				}
			}
		}
		
        //save the css in the file using cache
        $cache = yit_get_model('cache');
		                   
        global $wpdb;             
        $index = $wpdb->blogid != 0 ? '-' . $wpdb->blogid : '';
        $this->_styleFilename = str_replace( '.css', $index . '.css', $this->_styleFilename );
                                                       
 		if( YIT_DEBUG || $cache->is_expired( $this->_styleFilename) ) { 
 			$cache->save( $this->_styleFilename, $this->_style );    
 		}

        wp_enqueue_style( "styles-minified", yit_remove_protocol_url( yit_get_model( 'cache' )->locate_url( yit_remove_protocol_url( $this->_styleFilename ) ) ) );

		//include the excluded stylesheets above
		foreach( $excludedStylesheets as $s ) {
			extract($s);
			wp_enqueue_style( $handle, yit_remove_protocol_url($src), $deps, $ver, $media );
		}
	}
示例#7
0
    /**
     * Retrieve the URL of the favicon.
     *
     * @return string
     * @since 1.0.0
     */
    function yit_get_favicon() {
        $url = yit_get_option( 'favicon' );

        if( empty( $url ) )
        { $url = get_template_directory_uri() . '/favicon.ico'; }

        return yit_remove_protocol_url( $url );
    }