當前位置: 首頁>>代碼示例>>PHP>>正文


PHP woo_generate_font_css函數代碼示例

本文整理匯總了PHP中woo_generate_font_css函數的典型用法代碼示例。如果您正苦於以下問題:PHP woo_generate_font_css函數的具體用法?PHP woo_generate_font_css怎麽用?PHP woo_generate_font_css使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了woo_generate_font_css函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: woo_custom_typography

 function woo_custom_typography()
 {
     // Get options
     global $woo_options;
     // Reset
     $output = '';
     $default_google_font = false;
     // Add Text title and tagline if text title option is enabled
     if (isset($woo_options['woo_texttitle']) && $woo_options['woo_texttitle'] == 'true') {
         if ($woo_options['woo_font_site_title']) {
             $output .= '#header .site-title a {' . woo_generate_font_css($woo_options['woo_font_site_title']) . '}' . "\n";
         }
         if ($woo_options['woo_tagline'] == "true" and $woo_options['woo_font_tagline']) {
             $output .= '#header .site-description {' . woo_generate_font_css($woo_options['woo_font_tagline']) . '}' . "\n";
         }
     }
     if (isset($woo_options['woo_typography']) && $woo_options['woo_typography'] == 'true') {
         if (isset($woo_options['woo_font_body']) && $woo_options['woo_font_body']) {
             $output .= 'body { ' . woo_generate_font_css($woo_options['woo_font_body'], '1.5') . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_nav']) && $woo_options['woo_font_nav']) {
             $output .= '#navigation { font-size: 1em; } #navigation .nav a { ' . woo_generate_font_css($woo_options['woo_font_nav'], '1.4') . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_intro_section']) && $woo_options['woo_font_intro_section']) {
             $output .= '#intro h1 { ' . woo_generate_font_css($woo_options['woo_font_intro_section'], '1.3') . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_page_title']) && $woo_options['woo_font_page_title']) {
             $output .= '.page header h1 { ' . woo_generate_font_css($woo_options['woo_font_page_title'], '1.2') . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_post_title']) && $woo_options['woo_font_post_title']) {
             $output .= '.post header h1 { font-size: 1em; }  .single-post .post header h1, .post header h1 a:link, .post header h1 a:visited { ' . woo_generate_font_css($woo_options['woo_font_post_title'], '1.2') . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_post_meta']) && $woo_options['woo_font_post_meta']) {
             $output .= '.post-meta { ' . woo_generate_font_css($woo_options['woo_font_post_meta']) . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_post_entry']) && $woo_options['woo_font_post_entry']) {
             $output .= '.entry, .entry p { ' . woo_generate_font_css($woo_options['woo_font_post_entry'], '1.5') . ' } h1, h2, h3, h4, h5, h6 { font-family: ' . stripslashes($woo_options['woo_font_post_entry']['face']) . ', arial, sans-serif; }' . "\n";
         }
         if (isset($woo_options['woo_font_widget_titles']) && $woo_options['woo_font_widget_titles']) {
             $output .= '.widget h3 { ' . woo_generate_font_css($woo_options['woo_font_widget_titles']) . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_widget_titles']) && $woo_options['woo_font_widget_titles']) {
             $output .= '.widget h3 { ' . woo_generate_font_css($woo_options['woo_font_widget_titles']) . ' }' . "\n";
         }
         // Component titles
         if (isset($woo_options['woo_font_component_titles']) && $woo_options['woo_font_component_titles']) {
             $output .= '.component h2.component-title { ' . woo_generate_font_css($woo_options['woo_font_component_titles']) . ' }' . "\n";
         }
         // Add default typography Google Font
     } else {
         // Load default Google Fonts
         global $default_google_fonts;
         if (is_array($default_google_fonts) and count($default_google_fonts) > 0) {
             $count = 0;
             foreach ($default_google_fonts as $font) {
                 $count++;
                 $woo_options['woo_default_google_font_' . $count] = array('face' => $font);
             }
             $default_google_font = true;
         }
     }
     // Output styles
     if (isset($output) && $output != '') {
         // Load Google Fonts stylesheet in HEAD
         if (function_exists('woo_google_webfonts')) {
             woo_google_webfonts();
         }
         $output = "\n" . "<!-- Woo Custom Typography -->\n<style type=\"text/css\">\n" . $output . "</style>\n";
         echo $output;
         // Check if default google font is set and load Google Fonts stylesheet in HEAD
     } elseif ($default_google_font) {
         // Enable Google Fonts stylesheet in HEAD
         if (function_exists('woo_google_webfonts')) {
             woo_google_webfonts();
         }
     }
 }
開發者ID:jaiweb,項目名稱:ASP,代碼行數:77,代碼來源:theme-actions.php

示例2: woo_custom_typography

 function woo_custom_typography()
 {
     // Get options
     global $woo_options;
     // Reset
     $output = '';
     // Add Text title and tagline if text title option is enabled
     if (isset($woo_options['woo_texttitle']) && $woo_options['woo_texttitle'] == 'true') {
         if ($woo_options['woo_font_site_title']) {
             $output .= 'body #wrapper #logo .site-title a { ' . woo_generate_font_css($woo_options['woo_font_site_title']) . ' }' . "\n";
         }
         if ($woo_options['woo_tagline'] == "true" and $woo_options['woo_font_tagline']) {
             $output .= '#logo .site-description { ' . woo_generate_font_css($woo_options['woo_font_tagline']) . '; }' . "\n";
         }
     }
     if (isset($woo_options['woo_typography']) && $woo_options['woo_typography'] == 'true') {
         if (isset($woo_options['woo_font_body']) && $woo_options['woo_font_body']) {
             $output .= 'body { ' . woo_generate_font_css($woo_options['woo_font_body'], '1.5') . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_nav']) && $woo_options['woo_font_nav']) {
             $output .= '#navigation, #navigation .nav a { ' . woo_generate_font_css($woo_options['woo_font_nav'], '1.4') . ' !important; }' . "\n";
         }
         if (isset($woo_options['woo_font_post_title']) && $woo_options['woo_font_post_title']) {
             $output .= '.post .title { ' . woo_generate_font_css($woo_options['woo_font_post_title']) . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_post_meta']) && $woo_options['woo_font_post_meta']) {
             $output .= '.post-meta { ' . woo_generate_font_css($woo_options['woo_font_post_meta']) . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_post_entry']) && $woo_options['woo_font_post_entry']) {
             $output .= '.entry, .entry p { ' . woo_generate_font_css($woo_options['woo_font_post_entry'], '1.5') . ' } h1, h2, h3, h4, h5, h6 { font-family: ' . stripslashes($woo_options['woo_font_post_entry']['face']) . ', arial, sans-serif; }' . "\n";
         }
         if (isset($woo_options['woo_font_widget_titles']) && $woo_options['woo_font_widget_titles']) {
             $output .= '#sidebar .widget h3 { ' . woo_generate_font_css($woo_options['woo_font_widget_titles']) . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_footer_widget_titles']) && $woo_options['woo_font_footer_widget_titles']) {
             $output .= '#footer-widgets .widget h3 { ' . woo_generate_font_css($woo_options['woo_font_footer_widget_titles']) . ' }' . "\n";
         }
         // Add default typography Google Font
     } else {
         // Set default font face
         // $woo_options['woo_default_face'] = array('face' => 'Arial, Helvetica, sans-serif');
         // Output default font face
         if (isset($woo_options['woo_default_face']) && !empty($woo_options['woo_default_face'])) {
             $output .= 'h1, h2, h3, h4, h5, h6, .post .title, .archive_header { ' . woo_generate_font_css($woo_options['woo_default_face']) . ' }' . "\n";
         }
     }
     // Output styles
     if (isset($output) && $output != '') {
         // Enable Google Fonts stylesheet in HEAD
         if (function_exists('woo_google_webfonts')) {
             woo_google_webfonts();
         }
         $output = "<!-- Woo Custom Typography -->\n<style type=\"text/css\">\n" . $output . "</style>\n\n";
         echo $output;
     }
 }
開發者ID:nxtclass,項目名稱:NXTClass-themes,代碼行數:56,代碼來源:theme-actions.php

示例3: woo_custom_typography

 function woo_custom_typography()
 {
     // Get options
     global $woo_options;
     // Reset
     $output = '';
     // Add Text title and tagline if text title option is enabled
     if ($woo_options['woo_texttitle'] == "true") {
         if ($woo_options['woo_font_site_title']) {
             $output .= '#logo .site-title a {' . woo_generate_font_css($woo_options['woo_font_site_title']) . '}' . "\n";
         }
         if ($woo_options['woo_tagline'] == "true" and $woo_options['woo_font_tagline']) {
             $output .= '#logo .site-description {' . woo_generate_font_css($woo_options['woo_font_tagline']) . '}' . "\n";
         }
     }
     if ($woo_options['woo_typography'] == "true") {
         if ($woo_options['woo_font_body']) {
             $output .= 'body { ' . woo_generate_font_css($woo_options['woo_font_body'], '1.5') . ' }' . "\n";
         }
         if ($woo_options['woo_font_nav']) {
             $output .= '#navigation, #navigation .nav a { ' . woo_generate_font_css($woo_options['woo_font_nav'], '1.4') . ' }' . "\n";
         }
         if ($woo_options['woo_font_post_title']) {
             $output .= '.post .title, .archive_header { ' . woo_generate_font_css($woo_options['woo_font_post_title']) . ' }' . "\n";
         }
         if ($woo_options['woo_font_post_meta']) {
             $output .= '.post-meta { ' . woo_generate_font_css($woo_options['woo_font_post_meta']) . ' }' . "\n";
         }
         if ($woo_options['woo_font_post_entry']) {
             $output .= '.entry, .entry p { ' . woo_generate_font_css($woo_options['woo_font_post_entry'], '1.5') . ' } h1, h2, h3, h4, h5, h6 { font-family: \'' . stripslashes($woo_options['woo_font_post_entry']['face']) . '\', sans-serif; }' . "\n";
         }
         if ($woo_options['woo_font_widget_titles']) {
             $output .= '.widget h3 { ' . woo_generate_font_css($woo_options['woo_font_widget_titles']) . ' }' . "\n";
         }
         // Add default typography Google Font
     } else {
         $woo_options['woo_just_face'] = array('face' => 'Droid Sans');
         $output .= 'body, h1, h2, h3, h4, h5, h6, .widget h3, .post .title, .section .post .title, .archive_header, .entry, .entry p, .post-meta { ' . woo_generate_font_css($woo_options['woo_just_face']) . ' }' . "\n";
         $woo_options['woo_just_face'] = array('face' => 'Droid Serif');
         $output .= '.feedback blockquote p, #post-entries, #breadcrumbs { ' . woo_generate_font_css($woo_options['woo_just_face']) . ' }' . "\n";
     }
     // Output styles
     if (isset($output) && $output != '') {
         // Enable Google Fonts stylesheet in HEAD
         if (function_exists('woo_google_webfonts')) {
             woo_google_webfonts();
         }
         $output = "\n<!-- Woo Custom Typography -->\n<style type=\"text/css\">\n" . $output . "</style>\n";
         echo $output;
     }
 }
開發者ID:macconsultinggroup,項目名稱:WordPress,代碼行數:51,代碼來源:theme-actions.php

示例4: woo_custom_styling


//.........這裏部分代碼省略.........
             $wrapper .= 'padding-left:30px; padding-right:30px;';
         }
     }
     if ($boxed == "true" && $box_bg) {
         $wrapper .= 'background-color:' . $box_bg . ';';
     }
     if ($boxed == "true" && ($box_margin_top || $box_margin_bottom)) {
         $wrapper .= 'margin-top:' . $box_margin_top . 'px;margin-bottom:' . $box_margin_bottom . 'px;';
     }
     if ($boxed == "true" && $box_border_tb["width"] > 0) {
         $wrapper .= 'border-top:' . $box_border_tb["width"] . 'px ' . $box_border_tb["style"] . ' ' . $box_border_tb["color"] . ';border-bottom:' . $box_border_tb["width"] . 'px ' . $box_border_tb["style"] . ' ' . $box_border_tb["color"] . ';';
     }
     if ($boxed == "true" && $box_border_lr["width"] > 0) {
         $wrapper .= 'border-left:' . $box_border_lr["width"] . 'px ' . $box_border_lr["style"] . ' ' . $box_border_lr["color"] . ';border-right:' . $box_border_lr["width"] . 'px ' . $box_border_lr["style"] . ' ' . $box_border_lr["color"] . ';';
     }
     if ($boxed == "true" && $box_border_radius) {
         $wrapper .= 'border-radius:' . $box_border_radius . ';-moz-border-radius:' . $box_border_radius . ';-webkit-border-radius:' . $box_border_radius . ';';
     }
     if ($boxed == "true" && $box_shadow == "true") {
         $wrapper .= 'box-shadow: 0px 1px 5px rgba(0,0,0,.3);-moz-box-shadow: 0px 1px 5px rgba(0,0,0,.3);-webkit-box-shadow: 0px 1px 5px rgba(0,0,0,.3);';
     }
     if ($wrapper != '') {
         $output .= '#wrapper {' . $wrapper . '}' . "\n";
     }
     // General Typography
     $font_text = $woo_options['woo_font_text'];
     $font_h1 = $woo_options['woo_font_h1'];
     $font_h2 = $woo_options['woo_font_h2'];
     $font_h3 = $woo_options['woo_font_h3'];
     $font_h4 = $woo_options['woo_font_h4'];
     $font_h5 = $woo_options['woo_font_h5'];
     $font_h6 = $woo_options['woo_font_h6'];
     if ($font_text) {
         $output .= 'body, p { ' . woo_generate_font_css($font_text, 1.5) . ' }' . "\n";
     }
     if ($font_h1) {
         $output .= 'h1 { ' . woo_generate_font_css($font_h1, 1.5) . ' }';
     }
     if ($font_h2) {
         $output .= 'h2 { ' . woo_generate_font_css($font_h2, 1.5) . ' }';
     }
     if ($font_h3) {
         $output .= 'h3 { ' . woo_generate_font_css($font_h3, 1.5) . ' }';
     }
     if ($font_h4) {
         $output .= 'h4 { ' . woo_generate_font_css($font_h4, 1.5) . ' }';
     }
     if ($font_h5) {
         $output .= 'h5 { ' . woo_generate_font_css($font_h5, 1.5) . ' }';
     }
     if ($font_h6) {
         $output .= 'h6 { ' . woo_generate_font_css($font_h6, 1.5) . ' }' . "\n";
     }
     // Post Styling
     $font_post_title = $woo_options['woo_font_post_title'];
     $font_post_meta = $woo_options['woo_font_post_meta'];
     $font_post_text = $woo_options['woo_font_post_text'];
     $font_post_more = $woo_options['woo_font_post_more'];
     $post_more_border_top = $woo_options['woo_post_more_border_top'];
     $post_more_border_bottom = $woo_options['woo_post_more_border_bottom'];
     $post_comments_bg = $woo_options['woo_post_comments_bg'];
     $post_author_border_top = $woo_options['woo_post_author_border_top'];
     $post_author_border_bottom = $woo_options['woo_post_author_border_bottom'];
     $post_author_border_lr = $woo_options['woo_post_author_border_lr'];
     $post_author_border_radius = $woo_options['woo_post_author_border_radius'];
     $post_author_bg = $woo_options['woo_post_author_bg'];
開發者ID:stevehanlon,項目名稱:WooThemes-Canvas-Foundation-Zombie,代碼行數:67,代碼來源:theme-actions.php

示例5: woo_custom_styling


//.........這裏部分代碼省略.........
     if ($header_bg) {
         $header_css .= 'background-color:' . $header_bg . ';';
     }
     if ($header_bg_image) {
         $header_css .= 'background-image:url(' . $header_bg_image . ');';
     }
     if ($header_bg_image_repeat) {
         $header_css .= 'background-repeat:' . $header_bg_image_repeat . ';background-position:top center;';
     }
     if ($header_margin_top != '' || $header_margin_bottom != '') {
         $header_css .= 'margin-top:' . $header_margin_top . 'px;margin-bottom:' . $header_margin_bottom . 'px;';
     }
     if ($header_padding_top != '' || $header_padding_bottom != '') {
         $header_css .= 'padding-top:' . $header_padding_top . 'px;padding-bottom:' . $header_padding_bottom . 'px;';
     }
     if ($header_border && $header_border['width'] >= 0) {
         $header_css .= 'border:' . $header_border["width"] . 'px ' . $header_border["style"] . ' ' . $header_border["color"] . ';';
     }
     /*if ( $header_border && $header_border['width'] > 0) {
     			$width = get_option('woo_layout_width') - $header_border['width']*2;
     			if ( $width > 0 )
     				$header_css .= 'width:'.$width.'px;';
     		}*/
     if ($header_css != '') {
         $output .= '#header {' . $header_css . '}' . "\n";
     }
     if ($header_padding_left != '') {
         $output .= '#logo {padding-left:' . $header_padding_left . 'px;}';
     }
     if ($header_padding_right != '') {
         $output .= '#topad {padding-right:' . $header_padding_right . 'px;}' . "\n";
     }
     if ($font_logo) {
         $output .= '#logo .site-title a {' . woo_generate_font_css($font_logo) . '}' . "\n";
     }
     if ($font_desc) {
         $output .= '#logo .site-description {' . woo_generate_font_css($font_desc) . '}' . "\n";
     }
     // Boxed styling
     $boxed = $woo_options['woo_layout_boxed'];
     $box_bg = $woo_options['woo_style_box_bg'];
     $box_margin_top = $woo_options['woo_box_margin_top'];
     $box_margin_bottom = $woo_options['woo_box_margin_bottom'];
     $box_border_tb = $woo_options['woo_box_border_tb'];
     $box_border_lr = $woo_options['woo_box_border_lr'];
     $box_border_radius = $woo_options['woo_box_border_radius'];
     $box_shadow = $woo_options['woo_box_shadow'];
     $wrapper = '';
     if ($boxed == "true") {
         //$wrapper .= 'margin:0 auto;padding:0 0 20px 0;width:'.get_option('woo_layout_width').';';
         if (get_option('woo_layout_width') == '940px') {
             $wrapper .= 'padding-left:20px; padding-right:20px;';
         } else {
             $wrapper .= 'padding-left:30px; padding-right:30px;';
         }
     }
     if ($boxed == "true" && $box_bg) {
         $wrapper .= 'background-color:' . $box_bg . ';';
     }
     if ($boxed == "true" && ($box_margin_top || $box_margin_bottom)) {
         $wrapper .= 'margin-top:' . $box_margin_top . 'px;margin-bottom:' . $box_margin_bottom . 'px;';
     }
     if ($boxed == "true" && $box_border_tb["width"] > 0) {
         $wrapper .= 'border-top:' . $box_border_tb["width"] . 'px ' . $box_border_tb["style"] . ' ' . $box_border_tb["color"] . ';border-bottom:' . $box_border_tb["width"] . 'px ' . $box_border_tb["style"] . ' ' . $box_border_tb["color"] . ';';
     }
     if ($boxed == "true" && $box_border_lr["width"] > 0) {
開發者ID:jospintedjou,項目名稱:wordpress,代碼行數:67,代碼來源:theme-actions.php

示例6: woo_display_header_styles

    function woo_display_header_styles()
    {
        $settings = array('header_typography' => '', 'header_shadow' => 'true', 'header_shadow_color' => '#333333', 'header_bg_color' => '', 'header_bg_img' => '', 'header_bg_repeat' => '', 'header_bg_pos' => '', 'header_bg_attachment' => '');
        $settings = woo_get_dynamic_values($settings);
        global $woo_options;
        ?>
<style type="text/css">
	#header  {
		<?php 
        if ($settings['header_bg_color'] != '') {
            ?>
			background-color: <?php 
            echo $settings['header_bg_color'];
            ?>
!important;
		<?php 
        }
        ?>
		<?php 
        if ($settings['header_bg_img'] != '') {
            ?>
			background-image: url(<?php 
            echo esc_url($settings['header_bg_img']);
            ?>
);
		<?php 
        }
        ?>
		<?php 
        if ($settings['header_bg_repeat'] != '') {
            ?>
			background-repeat: <?php 
            echo $settings['header_bg_repeat'];
            ?>
;
		<?php 
        }
        ?>
		<?php 
        if ($settings['header_bg_pos'] != '') {
            ?>
			background-position: <?php 
            echo $settings['header_bg_pos'];
            ?>
;
		<?php 
        }
        ?>
		<?php 
        if ($settings['header_bg_attachment'] != '') {
            ?>
			background-attachment: <?php 
            echo $settings['header_bg_attachment'];
            ?>
;
		<?php 
        }
        ?>
	}

	<?php 
        if (isset($woo_options['woo_header_typography'])) {
            echo '#header p { ' . woo_generate_font_css($woo_options['woo_header_typography']) . ' }' . "\n";
        }
        ?>

	<?php 
        if ($settings['header_shadow'] == 'true') {
            ?>
		#header p  {

			<?php 
            if ($settings['header_shadow_color'] != '') {
                ?>
				text-shadow: 1px 1px 0 <?php 
                echo $settings['header_shadow_color'];
                ?>
;
			<?php 
            }
            ?>

		}
	<?php 
        }
        ?>

</style>
<?php 
    }
開發者ID:sanjeevpraja,項目名稱:wordpress-theme,代碼行數:90,代碼來源:theme-actions.php

示例7: woo_custom_typography

 function woo_custom_typography()
 {
     // Get options
     global $woo_options;
     // Reset
     $output = '';
     // Add Text title and tagline if text title option is enabled
     if ($woo_options['woo_texttitle'] == "true") {
         if ($woo_options['woo_font_site_title']) {
             $output .= '#logo .site-title a {' . woo_generate_font_css($woo_options['woo_font_site_title']) . '}' . "\n";
         }
         if ($woo_options['woo_font_tagline']) {
             $output .= '#logo .site-description {' . woo_generate_font_css($woo_options['woo_font_tagline']) . '}' . "\n";
         }
     }
     if ($woo_options['woo_typography'] == "true") {
         if ($woo_options['woo_font_body']) {
             $output .= 'body { ' . woo_generate_font_css($woo_options['woo_font_body'], '1.5') . ' }' . "\n";
         }
         if ($woo_options['woo_font_about']) {
             $output .= '#about .bio p { ' . woo_generate_font_css($woo_options['woo_font_about'], '1.5') . ' }' . "\n";
         }
         if ($woo_options['woo_font_nav']) {
             $output .= '.nav a:link, .nav a:visited { ' . woo_generate_font_css($woo_options['woo_font_nav'], '1.4') . ' }' . "\n";
         }
         if ($woo_options['woo_font_post_title']) {
             $output .= '.post .title { ' . woo_generate_font_css($woo_options['woo_font_post_title']) . ' }' . "\n";
         }
         if ($woo_options['woo_font_post_meta']) {
             $output .= '.post .post-meta { ' . woo_generate_font_css($woo_options['woo_font_post_meta']) . ' }' . "\n";
         }
         if ($woo_options['woo_font_post_entry']) {
             $output .= '.entry, .entry p { ' . woo_generate_font_css($woo_options['woo_font_post_entry'], '1.5') . ' } h1, h2, h3, h4, h5, h6 { font-family:' . stripslashes($woo_options['woo_font_post_entry']['face']) . '}' . "\n";
         }
         if ($woo_options['woo_font_widget_titles']) {
             $output .= '.widget h3 { ' . woo_generate_font_css($woo_options['woo_font_widget_titles'], '2') . ' }' . "\n";
         }
     }
     // Output styles
     if (isset($output) && $output != "") {
         // Enable Google Fonts stylesheet in HEAD
         if (function_exists('woo_google_webfonts')) {
             woo_google_webfonts();
         }
         $output = "\n<!-- Woo Custom Typography -->\n<style type=\"text/css\">\n" . $output . "</style>\n";
         echo $output;
     }
 }
開發者ID:niko-lgdcom,項目名稱:archives,代碼行數:48,代碼來源:theme-actions.php

示例8: woo_custom_typography

 function woo_custom_typography()
 {
     // Get options
     global $woo_options;
     // Reset
     $output = '';
     // Add Text title and tagline if text title option is enabled
     if ($woo_options['woo_texttitle'] == "true") {
         if ($woo_options['woo_font_site_title']) {
             $output .= '#logo .site-title a {' . woo_generate_font_css($woo_options['woo_font_site_title']) . '}' . "\n";
         }
         if ($woo_options['woo_font_tagline']) {
             $output .= '#tagline .site-description {' . woo_generate_font_css($woo_options['woo_font_tagline']) . '; line-height:28px; }' . "\n";
         }
     }
     if ($woo_options['woo_typography'] == "true") {
         if ($woo_options['woo_font_body']) {
             $output .= 'body { ' . woo_generate_font_css($woo_options['woo_font_body'], '1.5') . ' }' . "\n";
         }
         if ($woo_options['woo_font_nav']) {
             $output .= '#navigation .nav a { ' . woo_generate_font_css($woo_options['woo_font_nav']) . ' }' . "\n";
         }
         if ($woo_options['woo_font_post_title']) {
             $output .= '.post .title { ' . woo_generate_font_css($woo_options['woo_font_post_title']) . ' }' . "\n";
         }
         $output .= '#feat-title .title { font-family:' . stripslashes($woo_options['woo_font_post_title']['face']) . '; }' . "\n";
         if ($woo_options['woo_font_post_meta']) {
             $output .= '.post-meta { ' . woo_generate_font_css($woo_options['woo_font_post_meta']) . ' }' . "\n";
         }
         if ($woo_options['woo_font_post_entry']) {
             $output .= '.entry, .entry p { ' . woo_generate_font_css($woo_options['woo_font_post_entry'], '1.5') . ' } h1, h2, h3, h4, h5, h6 { font-family:' . stripslashes($woo_options['woo_font_post_entry']['face']) . '}' . "\n";
         }
         if ($woo_options['woo_font_widget_titles']) {
             $output .= '.widget h3 { ' . woo_generate_font_css($woo_options['woo_font_widget_titles']) . ' }' . "\n";
         }
         // Add default typography Google Font
     } else {
         $woo_options['woo_just_face'] = array('face' => 'PT Sans');
         $output .= 'h1, h2, h3, h4, h5, h6, .widget h3, .post .title, .nav a, .section .post .title, .archive_header, .site-description, #tabs-home ul.wooTabs li a { ' . woo_generate_font_css($woo_options['woo_just_face']) . ' }' . "\n";
     }
     // Output styles
     if (isset($output) && $output != '') {
         // Enable Google Fonts stylesheet in HEAD
         if (function_exists('woo_google_webfonts')) {
             woo_google_webfonts();
         }
         $output = "<!-- Woo Custom Typography -->\n<style type=\"text/css\">\n" . $output . "</style>\n\n";
         echo $output;
     }
 }
開發者ID:nuevomediagroup,項目名稱:nmg-code,代碼行數:50,代碼來源:theme-actions.php

示例9: woo_custom_styling

 function woo_custom_styling()
 {
     global $woo_options;
     $output = '';
     // Logo
     if (isset($woo_options['woo_logo']) && $woo_options['woo_logo']) {
         $output .= '#logo .site-title, #logo .site-description { display:none; }' . "\n";
     }
     // Check if we want to generate the custom styling or not.
     if (!isset($woo_options['woo_style_disable'])) {
         $woo_options['woo_style_disable'] = 'false';
     }
     if ('true' == $woo_options['woo_style_disable']) {
         // We still output the CSS related to the custom logo, if one exists.
         if ('' != $output) {
             echo $output;
         }
         return;
     }
     // Init options
     $options_init = array('woo_style_bg', 'woo_style_bg_image', 'woo_style_bg_image_repeat', 'woo_style_bg_image_pos', 'woo_style_bg_image_attach', 'woo_border_top', 'woo_style_border', 'woo_link_color', 'woo_link_hover_color', 'woo_button_color', 'woo_button_hover_color', 'woo_header_bg', 'woo_header_bg_image', 'woo_header_bg_image_repeat', 'woo_header_border', 'woo_header_margin_top', 'woo_header_margin_bottom', 'woo_header_padding_top', 'woo_header_padding_bottom', 'woo_header_padding_left', 'woo_header_padding_right', 'woo_font_logo', 'woo_font_desc', 'woo_layout_boxed', 'woo_style_box_bg', 'woo_box_margin_top', 'woo_box_margin_bottom', 'woo_box_border_tb', 'woo_box_border_lr', 'woo_box_border_radius', 'woo_box_shadow', 'woo_full_header_full_width_bg', 'woo_full_header_bg_image', 'woo_full_header_bg_image_repeat', 'woo_nav_bg', 'woo_nav_divider_border', 'woo_nav_border_top', 'woo_nav_border_bot', 'woo_foot_full_width_widget_bg', 'woo_footer_full_width_bg', 'woo_footer_border_top', 'woo_font_text', 'woo_font_h1', 'woo_font_h2', 'woo_font_h3', 'woo_font_h4', 'woo_font_h5', 'woo_font_h6', 'woo_font_post_title', 'woo_font_post_meta', 'woo_font_post_text', 'woo_font_post_more', 'woo_post_more_border_top', 'woo_post_more_border_bottom', 'woo_post_comments_bg', 'woo_post_author_border_top', 'woo_post_author_border_bottom', 'woo_post_author_border_lr', 'woo_post_author_border_radius', 'woo_post_author_bg', 'woo_pagenav_font', 'woo_pagenav_bg', 'woo_pagenav_border_top', 'woo_pagenav_border_bottom', 'woo_widget_font_title', 'woo_widget_font_text', 'woo_widget_padding_tb', 'woo_widget_padding_lr', 'woo_widget_bg', 'woo_widget_border', 'woo_widget_title_border', 'woo_widget_border_radius', 'woo_widget_tabs_bg', 'woo_widget_tabs_bg_inside', 'woo_widget_tabs_font', 'woo_widget_tabs_font_meta', 'woo_nav_bg', 'woo_nav_font', 'woo_nav_hover', 'woo_nav_hover_bg', 'woo_nav_divider_border', 'woo_nav_dropdown_border', 'woo_nav_border_lr', 'woo_nav_border_radius', 'woo_nav_border_top', 'woo_nav_border_bot', 'woo_nav_margin_top', 'woo_nav_margin_bottom', 'woo_top_nav_bg', 'woo_top_nav_hover', 'woo_top_nav_hover_bg', 'woo_top_nav_font', 'woo_footer_font', 'woo_footer_bg', 'woo_footer_border_top', 'woo_footer_border_bottom', 'woo_footer_border_lr', 'woo_footer_border_radius', 'woo_slider_magazine_font_title', 'woo_slider_magazine_font_excerpt', 'woo_magazine_grid_font_post_title', 'woo_slider_biz_font_title', 'woo_slider_biz_font_excerpt', 'woo_slider_biz_overlay', 'woo_archive_header_font', 'woo_archive_header_border_bottom');
     foreach ($options_init as $option) {
         if (isset($woo_options[$option])) {
             ${$option} = $woo_options[$option];
         } else {
             ${$option} = false;
         }
     }
     // Layout styling
     $body = '';
     if ($woo_style_bg) {
         $body .= 'background-color:' . $woo_style_bg . ';';
     }
     if ($woo_style_bg_image) {
         $body .= 'background-image:url(' . $woo_style_bg_image . ');';
     }
     if ($woo_style_bg_image_repeat) {
         $body .= 'background-repeat:' . $woo_style_bg_image_repeat . ';';
     }
     if ($woo_style_bg_image_pos) {
         $body .= 'background-position:' . $woo_style_bg_image_pos . ';';
     }
     if ($woo_style_bg_image_attach) {
         $body .= 'background-attachment:' . $woo_style_bg_image_attach . ';';
     }
     if ($woo_border_top && $woo_border_top['width'] >= 0) {
         $body .= 'border-top:' . $woo_border_top["width"] . 'px ' . $woo_border_top["style"] . ' ' . $woo_border_top["color"] . ';';
     }
     if ($body != '') {
         $output .= 'body {' . $body . '}' . "\n";
     }
     if ($woo_style_border) {
         $output .= 'hr, .entry img, img.thumbnail, .entry .wp-caption, #footer-widgets, #comments, #comments .comment.thread-even, #comments ul.children li, .entry h1{border-color:' . $woo_style_border . '}' . "\n";
     }
     // General styling
     if ($woo_link_color) {
         $output .= 'a:link, a:visited, #loopedSlider a.flex-prev:hover, #loopedSlider a.flex-next:hover {color:' . $woo_link_color . '} .quantity .plus, .quantity .minus {background-color: ' . $woo_link_color . ';}' . "\n";
     }
     if ($woo_link_hover_color) {
         $output .= 'a:hover, .post-more a:hover, .post-meta a:hover, .post p.tags a:hover {color:' . $woo_link_hover_color . '}' . "\n";
     }
     if ($woo_button_color) {
         $output .= 'body #wrapper .button, body #wrapper #content .button, body #wrapper #content .button:visited, body #wrapper #content .reply a, body #wrapper #content #respond .form-submit input#submit, input[type=submit], body #wrapper #searchsubmit, #navigation ul.cart .button, body #wrapper .woo-sc-button {border: none; background:' . $woo_button_color . '}' . "\n";
     }
     if ($woo_button_hover_color) {
         $output .= 'body #wrapper .button:hover, body #wrapper #content .button:hover, body #wrapper #content .reply a:hover, body #wrapper #content #respond .form-submit input#submit:hover, input[type=submit]:hover, body #wrapper #searchsubmit:hover, #navigation ul.cart .button:hover, body #wrapper .woo-sc-button:hover {border: none; background:' . $woo_button_hover_color . '}' . "\n";
     }
     // Header styling
     $header_css = '';
     if ($woo_header_bg) {
         $header_css .= 'background-color:' . $woo_header_bg . ';';
     }
     if ($woo_header_bg_image) {
         $header_css .= 'background-image:url(' . $woo_header_bg_image . ');';
     }
     if ($woo_header_bg_image_repeat) {
         $header_css .= 'background-repeat:' . $woo_header_bg_image_repeat . ';background-position:left top;';
     }
     if ($woo_header_margin_top != '' || $woo_header_margin_bottom != '') {
         $header_css .= 'margin-top:' . $woo_header_margin_top . 'px;margin-bottom:' . $woo_header_margin_bottom . 'px;';
     }
     if ($woo_header_padding_top != '' || $woo_header_padding_bottom != '') {
         $header_css .= 'padding-top:' . $woo_header_padding_top . 'px;padding-bottom:' . $woo_header_padding_bottom . 'px;';
     }
     if ($woo_header_border && $woo_header_border['width'] >= 0) {
         $header_css .= 'border:' . $woo_header_border["width"] . 'px ' . $woo_header_border["style"] . ' ' . $woo_header_border["color"] . ';';
     }
     if ($header_css != '') {
         $output .= '#header {' . $header_css . '}' . "\n";
     }
     if ($woo_header_padding_left != '') {
         $output .= '#logo {padding-left:' . $woo_header_padding_left . 'px;}';
     }
     if ($woo_header_padding_right != '') {
         $output .= '.header-widget {padding-right:' . $woo_header_padding_right . 'px;}' . "\n";
     }
     if ($woo_font_logo) {
         $output .= '#logo .site-title a {' . woo_generate_font_css($woo_font_logo) . '}' . "\n";
     }
     if ($woo_font_desc) {
//.........這裏部分代碼省略.........
開發者ID:plusplusminus,項目名稱:athol,代碼行數:101,代碼來源:theme-actions.php

示例10: woo_custom_typography

 function woo_custom_typography()
 {
     // Get options
     global $woo_options;
     // Reset
     $output = '';
     // Add Text title and tagline if text title option is enabled
     if (isset($woo_options['woo_texttitle']) && $woo_options['woo_texttitle'] == 'true') {
         if ($woo_options['woo_font_site_title']) {
             $output .= '#header .site-title a {' . woo_generate_font_css($woo_options['woo_font_site_title']) . '}' . "\n";
         }
         if ($woo_options['woo_tagline'] == "true" and $woo_options['woo_font_tagline']) {
             $output .= '#header .site-description {' . woo_generate_font_css($woo_options['woo_font_tagline']) . '}' . "\n";
         }
     }
     if (isset($woo_options['woo_typography']) && $woo_options['woo_typography'] == 'true') {
         if (isset($woo_options['woo_font_body']) && $woo_options['woo_font_body']) {
             $output .= 'body { ' . woo_generate_font_css($woo_options['woo_font_body'], '1.5') . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_nav']) && $woo_options['woo_font_nav']) {
             $output .= '#navigation, #navigation .nav a { ' . woo_generate_font_css($woo_options['woo_font_nav'], '1.4') . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_page_title']) && $woo_options['woo_font_page_title']) {
             $output .= '.page header h1 { ' . woo_generate_font_css($woo_options['woo_font_page_title']) . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_post_title']) && $woo_options['woo_font_post_title']) {
             $output .= '.post header h1, .post header h1 a:link, .post header h1 a:visited { ' . woo_generate_font_css($woo_options['woo_font_post_title']) . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_post_meta']) && $woo_options['woo_font_post_meta']) {
             $output .= '.post-meta { ' . woo_generate_font_css($woo_options['woo_font_post_meta']) . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_post_entry']) && $woo_options['woo_font_post_entry']) {
             $output .= '.entry, .entry p { ' . woo_generate_font_css($woo_options['woo_font_post_entry'], '1.5') . ' } h1, h2, h3, h4, h5, h6 { font-family: ' . stripslashes($woo_options['woo_font_post_entry']['face']) . ', arial, sans-serif; }' . "\n";
         }
         if (isset($woo_options['woo_font_widget_titles']) && $woo_options['woo_font_widget_titles']) {
             $output .= '.widget h3 { ' . woo_generate_font_css($woo_options['woo_font_widget_titles']) . ' }' . "\n";
         }
         if (isset($woo_options['woo_font_widget_titles']) && $woo_options['woo_font_widget_titles']) {
             $output .= '.widget h3 { ' . woo_generate_font_css($woo_options['woo_font_widget_titles']) . ' }' . "\n";
         }
         // Component titles
         if (isset($woo_options['woo_font_component_titles']) && $woo_options['woo_font_component_titles']) {
             $output .= '.component h2.component-title { ' . woo_generate_font_css($woo_options['woo_font_component_titles']) . ' }' . "\n";
         }
         // Add default typography Google Font
     } else {
         // Set default font face
         //$woo_options['woo_default_face'] = array('face' => 'Droid Serif');
         // Output default font face
         //if ( isset( $woo_options['woo_default_face'] ) && !empty( $woo_options['woo_default_face'] ) )
         //	$output .= 'h1, h2, h3, h4, h5, h6, .post .title, .page .title, .archive_header { '.woo_generate_font_css($woo_options['woo_default_face']).' }' . "\n";
         $woo_options['woo_just_face2'] = array('face' => 'Schoolbell');
         $output .= '.shortcode-sticky { ' . woo_generate_font_css($woo_options['woo_just_face2']) . ' }' . "\n";
     }
     // Output styles
     if (isset($output) && $output != '') {
         // Enable Google Fonts stylesheet in HEAD
         if (function_exists('woo_google_webfonts')) {
             woo_google_webfonts();
         }
         $output = "<!-- Woo Custom Typography -->\n<style type=\"text/css\">\n" . $output . "</style>\n\n";
         echo $output;
     }
 }
開發者ID:googlecode-mirror,項目名稱:wpmu-demo,代碼行數:64,代碼來源:theme-actions.php


注:本文中的woo_generate_font_css函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。