本文整理汇总了PHP中wp_add_inline_style函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_add_inline_style函数的具体用法?PHP wp_add_inline_style怎么用?PHP wp_add_inline_style使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_add_inline_style函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: surbma_divi_gravity_forms_enqueue_scripts
function surbma_divi_gravity_forms_enqueue_scripts()
{
if (wp_basename(get_bloginfo('template_directory')) == 'Divi' && class_exists('GFForms')) {
wp_enqueue_style('surbma-divi-gravity-forms-styles', plugins_url('', __FILE__) . '/css/surbma-divi-gravity-forms.css');
$accent_color = esc_html(et_get_option('accent_color', '#2ea3f2'));
$all_buttons_font_size = esc_html(et_get_option('all_buttons_font_size', '20'));
$all_buttons_text_color = esc_html(et_get_option('all_buttons_text_color', $accent_color));
$all_buttons_text_color_hover = esc_html(et_get_option('all_buttons_text_color_hover', $accent_color));
$all_buttons_bg_color = esc_html(et_get_option('all_buttons_bg_color', '#fff'));
$all_buttons_bg_color_hover = esc_html(et_get_option('all_buttons_bg_color_hover', 'rgba(0,0,0,.05)'));
$all_buttons_border_width = esc_html(et_get_option('all_buttons_border_width', '2'));
$all_buttons_border_color = esc_html(et_get_option('all_buttons_border_color', $accent_color));
$all_buttons_border_color_hover = esc_html(et_get_option('all_buttons_border_color_hover', 'transparent'));
$all_buttons_border_radius = esc_html(et_get_option('all_buttons_border_radius', '3'));
$all_buttons_border_radius_hover = esc_html(et_get_option('all_buttons_border_radius_hover', '3'));
$all_buttons_spacing = esc_html(et_get_option('all_buttons_spacing', '0'));
$all_buttons_spacing_hover = esc_html(et_get_option('all_buttons_spacing_hover', '0'));
$all_buttons_font_style = esc_html(et_get_option('all_buttons_font_style', '', '', true));
$button_text_style = '';
if ($all_buttons_font_style !== '') {
$button_text_style = et_pb_print_font_style($all_buttons_font_style);
}
$all_buttons_font = esc_html(et_get_option('all_buttons_font', 'inherit'));
$custom_css = "body .gform_wrapper .gform_footer input.button,body .gform_wrapper .gform_page_footer input.button{background-color:{$all_buttons_bg_color};color:{$accent_color};border-width:{$all_buttons_border_width}px;border-color:{$all_buttons_border_color};border-radius:{$all_buttons_border_radius}px;font-family:{$all_buttons_font};font-size:{$all_buttons_font_size}px;letter-spacing:{$all_buttons_spacing}px;{$button_text_style}}body .gform_wrapper .gform_footer input.button:hover,body .gform_wrapper .gform_page_footer input.button:hover{background-color:{$all_buttons_bg_color_hover};color:{$all_buttons_text_color_hover};border-color:{$all_buttons_border_color_hover};border-radius:{$all_buttons_border_radius_hover}px;letter-spacing:{$all_buttons_spacing_hover}px;}}";
wp_add_inline_style('surbma-divi-gravity-forms-styles', $custom_css);
}
}
开发者ID:planetahuevo,项目名称:surbma-divi-gravity-forms,代码行数:27,代码来源:surbma-divi-gravity-forms.php
示例2: content
protected function content($atts, $content = null)
{
$atts = shortcode_atts(array('element_id' => '', 'source' => '', 'cell_height' => 120, 'space' => 20, 'template' => '', 'class' => ''), $atts);
/**
* Enqueue script
*/
LemonGrid::include_script();
$templateParams = json_decode($atts['template'], true);
$atts['class_id'] = 'lemon_grid_id_' . $atts['element_id'];
$atts['template'] = $templateParams['template'];
$atts['template_params'] = $templateParams;
/**
* wp_query
*/
list($args, $wp_query) = vc_build_loop_query($atts['source']);
$paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1;
if ($paged > 1) {
$args['paged'] = $paged;
$wp_query = new WP_Query($args);
}
$atts['posts'] = $wp_query;
wp_enqueue_style('tb-lemongrid-custom-script', TB_CSS . 'lemongrid-custom-script.css');
wp_add_inline_style('tb-lemongrid-custom-script', renderGridCustomSpaceCss($atts['class_id'], $atts['space']));
return lgLoadTemplate($atts, $content);
}
开发者ID:BearsTheme,项目名称:lemongrid,代码行数:25,代码来源:post_lemongrid.php
示例3: coll_enqueue_styles
function coll_enqueue_styles()
{
global $coll_is_mobile;
if (!$coll_is_mobile) {
wp_register_style('scrollbar', get_template_directory_uri() . '/css/perfect-scrollbar.css');
wp_enqueue_style('scrollbar');
}
wp_register_style('googlefonts', '//fonts.googleapis.com/css?family=Bentham|Pinyon+Script|Bitter:400,700|Raleway:300,400,500,600|Sacramento|Lato:300,400,900|Open+Sans:400,700,800|Pacifico|Lobster|Roboto:400,900,700|Oswald:400,700');
wp_register_style('normalize', get_template_directory_uri() . '/css/normalize.css');
wp_register_style('foundation', get_template_directory_uri() . '/css/foundation.css', null, null);
wp_register_style('magicpopup', get_template_directory_uri() . '/css/magnific-popup.css');
wp_register_style('icons', get_template_directory_uri() . '/css/font-awesome.min.css');
wp_register_style('superfish', get_template_directory_uri() . '/css/superfish.css');
wp_register_style('flexslider', get_template_directory_uri() . '/css/flexslider.css', null, null);
wp_register_style('plugin', get_template_directory_uri() . '/css/plugin.css', null, null);
wp_register_style('public', get_template_directory_uri() . '/css/public.css', null, null);
wp_register_style('morpheus', get_stylesheet_uri(), null, null);
wp_enqueue_style('googlefonts');
wp_enqueue_style('foundation');
wp_enqueue_style('magicpopup');
wp_enqueue_style('icons');
wp_enqueue_style('superfish');
wp_enqueue_style('flexslider');
wp_enqueue_style('plugin');
wp_enqueue_style('public');
wp_enqueue_style('morpheus');
// add custom css
$custom_css = ot_get_option('coll_custom_css');
if (!empty($custom_css)) {
wp_add_inline_style('morpheus', $custom_css);
}
}
开发者ID:Air-Craft,项目名称:air-craft-www,代码行数:32,代码来源:enqueue.php
示例4: mss_enqueue_styles
/**
* Enqueue styles
* Inline styles with admin-bar dependency
*
* @return void
*/
function mss_enqueue_styles()
{
ob_start();
?>
#wp-admin-bar-my-sites-search.hide-if-no-js {
display: none;
}
#wp-admin-bar-my-sites-search label[for="my-sites-search-text"] {
clip: rect(1px, 1px, 1px, 1px);
position: absolute !important;
height: 1px;
width: 1px;
overflow: hidden;
}
#wp-admin-bar-my-sites-search {
height: 38px;
}
#wp-admin-bar-my-sites-search .ab-item {
height: 34px;
}
#wp-admin-bar-my-sites-search input {
padding: 0 2px;
width: 95%;
width: calc( 100% - 4px );
}
<?php
$style = ob_get_clean();
wp_enqueue_style('admin-bar');
wp_add_inline_style('admin-bar', $style);
}
开发者ID:trepmal,项目名称:my-sites-search,代码行数:36,代码来源:my-sites-search.php
示例5: fastnews_light_customize_logo
/**
* Custom logo
*/
function fastnews_light_customize_logo()
{
$custom_styles = '';
/* Logo */
$logo_margin_top = get_theme_mod('logo_margin_top', '');
$logo_margin_left = get_theme_mod('logo_margin_left', '');
$logo_margin = '';
if ($logo_margin_top) {
$logo_margin .= "margin-top:{$logo_margin_top}px;";
}
if ($logo_margin_left) {
$logo_margin .= "margin-left:{$logo_margin_left}px;";
}
if ($logo_margin) {
$custom_styles .= ".kopa-logo { {$logo_margin} }";
}
/* Logo navigation */
$logo_nav_margin_top = get_theme_mod('logo_nav_margin_top', '');
$logo_nav_margin_left = get_theme_mod('logo_nav_margin_left', '');
$logo_nav_margin = '';
if ($logo_nav_margin_top) {
$logo_nav_margin .= "margin-top:{$logo_nav_margin_top}px;";
}
if ($logo_nav_margin_left) {
$logo_nav_margin .= "margin-left:{$logo_nav_margin_left}px;";
}
if ($logo_nav_margin) {
$custom_styles .= ".nav-bar .kopa-logo { {$logo_nav_margin} }";
}
/* ==================================================================================================
* Theme Options custom styles
* ================================================================================================= */
wp_add_inline_style('kopa-style', $custom_styles);
}
开发者ID:jimdough,项目名称:Roadmaster,代码行数:37,代码来源:customize.php
示例6: footer_css
/**
* Extra CSS needed for the footer if text needs to be white.
*/
public function footer_css()
{
if ('#ffffff' == Daphnee_Customizer::max_readability(get_theme_mod('footer_background_color', '#333333'))) {
$style = '#colophon.site-footer{color:#fff;}#colophon.site-footer a{color:rgba(255,255,255,.8);}';
wp_add_inline_style('daphnee-style', $style);
}
}
开发者ID:presscodes,项目名称:daphnee,代码行数:10,代码来源:class-daphnee-dynamic-css.php
示例7: onAddScripts
/**
*
* a must function. you can not use it, but the function must stay there!
*/
public static function onAddScripts()
{
global $wp_version;
$slver = apply_filters('revslider_remove_version', RevSliderGlobals::SLIDER_REVISION);
$style_pre = '';
$style_post = '';
if ($wp_version < 3.7) {
$style_pre = '<style type="text/css">';
$style_post = '</style>';
}
$operations = new RevSliderOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = RevSliderFunctions::getVal($arrValues, "includes_globally", "on");
$includesFooter = RevSliderFunctions::getVal($arrValues, "js_to_footer", "off");
$strPutIn = RevSliderFunctions::getVal($arrValues, "pages_for_includes");
$isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
//put the includes only on pages with active widget or shortcode
// if the put in match, then include them always (ignore this if)
if ($isPutIn == false && $includesGlobally == "off") {
$isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
$hasShortcode = RevSliderFunctionsWP::hasShortcode("rev_slider");
if ($isWidgetActive == false && $hasShortcode == false) {
return false;
}
}
wp_enqueue_style('rs-plugin-settings', RS_PLUGIN_URL . 'public/assets/css/settings.css', array(), $slver);
$custom_css = RevSliderOperations::getStaticCss();
$custom_css = RevSliderCssParser::compress_css($custom_css);
if (trim($custom_css) == '') {
$custom_css = '#rs-demo-id {}';
}
wp_add_inline_style('rs-plugin-settings', $style_pre . $custom_css . $style_post);
$setBase = is_ssl() ? "https://" : "http://";
wp_enqueue_script(array('jquery'));
//add icon sets
//wp_register_style('rs-icon-set-fa-icon-', RS_PLUGIN_URL .'public/assets/fonts/font-awesome/css/font-awesome.css', array(), $slver);
//wp_register_style('rs-icon-set-pe-7s-', RS_PLUGIN_URL .'public/assets/fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css', array(), $slver);
if ($includesFooter == "off") {
$waitfor = array('jquery');
$enable_logs = RevSliderFunctions::getVal($arrValues, "enable_logs", 'off');
if ($enable_logs == 'on') {
wp_enqueue_script('enable-logs', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.enablelog.js', $waitfor, $slver);
$waitfor[] = 'enable-logs';
}
wp_enqueue_script('tp-tools', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.tools.min.js', $waitfor, $slver);
wp_enqueue_script('revmin', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.revolution.min.js', 'tp-tools', $slver);
} else {
//put javascript to footer
add_action('wp_footer', array('RevSliderFront', 'putJavascript'));
}
add_action('wp_head', array('RevSliderFront', 'add_meta_generator'));
add_action("wp_footer", array('RevSliderFront', "load_icon_fonts"));
// Async JS Loading
$js_defer = RevSliderBase::getVar($arrValues, 'js_defer', 'off');
if ($js_defer != 'off') {
add_filter('clean_url', array('RevSliderFront', 'add_defer_forscript'), 11, 1);
}
add_action('wp_before_admin_bar_render', array('RevSliderFront', 'add_admin_menu_nodes'));
add_action('wp_footer', array('RevSliderFront', 'putAdminBarMenus'));
}
开发者ID:dawnthemes,项目名称:tkb,代码行数:64,代码来源:revslider-front.class.php
示例8: supermag_dynamic_css
function supermag_dynamic_css()
{
global $supermag_customizer_all_values;
/*Color options */
$supermag_primary_color = $supermag_customizer_all_values['supermag-primary-color'];
$custom_css = '';
/*background*/
$custom_css .= "\r\n mark,\r\n .comment-form .form-submit input,\r\n .read-more,\r\n .bn-title,\r\n .home-icon.front_page_on,\r\n .header-wrapper .menu li:hover > a,\r\n .header-wrapper .menu > li.current-menu-item a,\r\n .header-wrapper .menu > li.current-menu-parent a,\r\n .header-wrapper .menu > li.current_page_parent a,\r\n .header-wrapper .menu > li.current_page_ancestor a,\r\n .header-wrapper .menu > li.current-menu-item > a:before,\r\n .header-wrapper .menu > li.current-menu-parent > a:before,\r\n .header-wrapper .menu > li.current_page_parent > a:before,\r\n .header-wrapper .menu > li.current_page_ancestor > a:before,\r\n .header-wrapper .main-navigation ul ul.sub-menu li:hover > a,\r\n .slider-section .cat-links a,\r\n .featured-desc .below-entry-meta .cat-links a,\r\n #calendar_wrap #wp-calendar #today,\r\n #calendar_wrap #wp-calendar #today a,\r\n .wpcf7-form input.wpcf7-submit:hover,\r\n .breadcrumb{\r\n background: {$supermag_primary_color};\r\n }\r\n ";
$custom_css .= "\r\n a:hover,\r\n .screen-reader-text:focus,\r\n .bn-content a:hover,\r\n .socials a:hover,\r\n .site-title a,\r\n .search-block input#menu-search,\r\n .widget_search input#s,\r\n .search-block #searchsubmit,\r\n .widget_search #searchsubmit,\r\n .footer-sidebar .featured-desc .above-entry-meta a:hover,\r\n .slider-section .slide-title:hover,\r\n .besides-slider .post-title a:hover,\r\n .slider-feature-wrap a:hover,\r\n .slider-section .bx-controls-direction a,\r\n .besides-slider .beside-post:hover .beside-caption,\r\n .besides-slider .beside-post:hover .beside-caption a:hover,\r\n .featured-desc .above-entry-meta span:hover,\r\n .posted-on a:hover,\r\n .cat-links a:hover,\r\n .comments-link a:hover,\r\n .edit-link a:hover,\r\n .tags-links a:hover,\r\n .byline a:hover,\r\n .nav-links a:hover,\r\n #supermag-breadcrumbs a:hover,\r\n .wpcf7-form input.wpcf7-submit {\r\n color: {$supermag_primary_color};\r\n }";
/*border*/
$custom_css .= "\r\n .search-block input#menu-search,\r\n .widget_search input#s,\r\n .tagcloud a{\r\n border: 1px solid {$supermag_primary_color};\r\n }";
$custom_css .= "\r\n .footer-wrapper .border,\r\n .nav-links .nav-previous a:hover,\r\n .nav-links .nav-next a:hover{\r\n border-top: 1px solid {$supermag_primary_color};\r\n }";
$custom_css .= "\r\n .besides-slider .beside-post{\r\n border-bottom: 3px solid {$supermag_primary_color};\r\n }";
$custom_css .= "\r\n .widget-title,\r\n .footer-wrapper,\r\n .page-header .page-title,\r\n .single .entry-header .entry-title{\r\n border-bottom: 1px solid {$supermag_primary_color};\r\n }";
$custom_css .= "\r\n .widget-title:before,\r\n .page-header .page-title:before,\r\n .single .entry-header .entry-title:before{\r\n border-bottom: 7px solid {$supermag_primary_color};\r\n }";
$custom_css .= "\r\n .wpcf7-form input.wpcf7-submit,\r\n article.post.sticky{\r\n border: 2px solid {$supermag_primary_color};\r\n }";
$custom_css .= "\r\n .breadcrumb::after {\r\n border-left: 5px solid {$supermag_primary_color};\r\n }";
$custom_css .= "\r\n .header-wrapper #site-navigation{\r\n border-bottom: 5px solid {$supermag_primary_color};\r\n }";
/*media width*/
$custom_css .= "\r\n @media screen and (max-width:992px){\r\n .slicknav_btn.slicknav_open{\r\n border: 1px solid {$supermag_primary_color};\r\n }\r\n .slicknav_btn.slicknav_open:before{\r\n background: { {$supermag_primary_color} };\r\n box-shadow: 0 6px 0 0 {$supermag_primary_color}, 0 12px 0 0 {$supermag_primary_color};\r\n }\r\n .slicknav_nav li:hover > a,\r\n .slicknav_nav li.current-menu-ancestor a,\r\n .slicknav_nav li.current-menu-item > a,\r\n .slicknav_nav li.current_page_item a,\r\n .slicknav_nav li.current_page_item .slicknav_item span,\r\n .slicknav_nav li .slicknav_item:hover a{\r\n color: {$supermag_primary_color};\r\n }\r\n }";
/*custom css*/
$supermag_custom_css = wp_filter_nohtml_kses($supermag_customizer_all_values['supermag-custom-css']);
if (!empty($supermag_custom_css)) {
$custom_css .= $supermag_custom_css;
}
wp_add_inline_style('supermag-style', $custom_css);
}
开发者ID:jasonralph,项目名称:jasonralph.org,代码行数:27,代码来源:dynamic-css.php
示例9: ht_theme_styles
/**
* Enqueues styles for front-end.
*/
function ht_theme_styles()
{
global $wp_styles;
/*
* Loads our main stylesheet.
*/
wp_enqueue_style('theme-style', get_stylesheet_uri());
/*
* Loads our Google Font.
*/
$subsets = 'latin,latin-ext';
$protocol = is_ssl() ? 'https' : 'http';
$query_args = array('family' => 'Open+Sans:400,400italic,600,600italic', 'subset' => $subsets);
wp_enqueue_style('theme-font', esc_url(add_query_arg($query_args, "{$protocol}://fonts.useso.com/css")), array(), null);
/*
* Add font awesome CSS
*/
wp_enqueue_style('font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array('theme-style'));
/*
* Add Lightbox CSS
*/
wp_enqueue_style('magnific-popup', get_template_directory_uri() . '/css/magnific-popup.css', array('theme-style'));
/*
* Load theme custom colors
*/
//Theme variables from theme customizer
$ht_styling_themecolor = get_theme_mod('ht_styling_themecolor', '#EC4B36');
// Convert theme colors from hex to rgb
$ht_styling_themecolor_rgb = hex2rgb($ht_styling_themecolor);
// Add custom styles
$custom_css = "\r\r\n\ta, a:visited, a:hover, \r\r\n\t.comment-action i {color: {$ht_styling_themecolor};}\r\r\n\tinput[type='submit'], \r\r\n\tinput[type='button'], \r\r\n\t.paging-navigation li a:hover, \r\r\n\t.hentry .entry-header:after, \r\r\n\t.hentry .entry-footer:before, \r\r\n\t.hentry .hentry-box > .entry-quote, \r\r\n\t.hentry .entry-link, \r\r\n\t.hentry .entry-status,\r\r\n\t#site-header #logo,\r\r\n\t.hentry .entry-date,\r\r\n\t.paging-navigation:after,\r\r\n\t#timeline > li .hentry:before {\r\r\n\t\tbackground: {$ht_styling_themecolor};\r\r\n\t}\r\r\n\t.entry-content a:hover, \r\r\n\t.entry-content blockquote, \r\r\n\tp.pullquote-left, \r\r\n\tp.pullquote-right,\r\r\n\t#social-icons li a:hover,\r\r\n\t#nav-primary > ul > li:hover > a {\r\r\n\t\tborder-color: {$ht_styling_themecolor};\r\r\n\t}\r\r\n\t#social-icons li a:hover,\r\r\n\t#nav-primary > ul > li:hover > a,\r\r\n\t#nav-primary ul ul li a:hover {\r\r\n\t\tcolor: {$ht_styling_themecolor};\r\r\n\t}\r\r\n\t.hentry .entry-thumb-caption, .gallery .gallery-item-caption {\r\r\n\tbackground: {$ht_styling_themecolor};\r\r\n\tbackground: rgba({$ht_styling_themecolor_rgb[0]},{$ht_styling_themecolor_rgb[1]},{$ht_styling_themecolor_rgb[2]},0.8);\r\r\n\t}\r\r\n\t";
wp_add_inline_style('theme-style', $custom_css);
}
开发者ID:jianqiangsong,项目名称:WordPress,代码行数:36,代码来源:styles.php
示例10: yit_revslider_slider
function yit_revslider_slider()
{
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally","on");
$isWidgetActive = is_active_widget( false, false, "rev-slider-widget", true );
$hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
if ( yit_slider_get_setting('slider_type',yit_slider_name()) != 'revolution-slider' || $includesGlobally == "on" || $isWidgetActive || $hasShortcode ) {
return;
}
wp_enqueue_style('rs-plugin-settings', RS_PLUGIN_URL .'public/assets/css/settings.css', array(), RevSliderGlobals::SLIDER_REVISION);
$custom_css = RevOperations::getStaticCss();
$custom_css = UniteCssParserRev::compress_css($custom_css);
wp_add_inline_style('rs-plugin-settings', $custom_css);
$setBase = (is_ssl()) ? "https://" : "http://";
$url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
wp_enqueue_script("jquery", $url_jquery);
// put javascript to footer
add_action('wp_footer', array($GLOBALS['productFront'], 'putJavascript'));
}
开发者ID:simonsays88,项目名称:costa,代码行数:28,代码来源:config.php
示例11: add_scripts
/**
* Enqueue scripts and styles
*/
function add_scripts()
{
if (empty($GLOBALS['posts']) || !is_array($GLOBALS['posts'])) {
return;
}
foreach ($GLOBALS['posts'] as $p) {
if (has_shortcode($p->post_content, 'recipe')) {
$this->scripts_and_style_included = true;
break;
}
}
if (!$this->scripts_and_style_included) {
return;
}
if (is_rtl()) {
wp_enqueue_style('jetpack-recipes-style', plugins_url('/css/rtl/recipes-rtl.css', __FILE__), array(), '20130919');
} else {
wp_enqueue_style('jetpack-recipes-style', plugins_url('/css/recipes.css', __FILE__), array(), '20130919');
}
wp_add_inline_style('jetpack-recipes-style', self::themecolor_styles());
// add $themecolors-defined styles
wp_enqueue_script('jetpack-recipes-printthis', plugins_url('/js/recipes-printthis.js', __FILE__), array('jquery'), '20131230');
wp_enqueue_script('jetpack-recipes-js', plugins_url('/js/recipes.js', __FILE__), array('jquery', 'jetpack-recipes-printthis'), '20131230');
$title_var = wp_title('|', false, 'right');
$print_css_var = plugins_url('/css/recipes-print.css', __FILE__);
wp_localize_script('jetpack-recipes-js', 'jetpack_recipes_vars', array('pageTitle' => $title_var, 'loadCSS' => $print_css_var));
}
开发者ID:kanei,项目名称:vantuch.cz,代码行数:30,代码来源:recipe.php
示例12: foundation_google_fonts_init
function foundation_google_fonts_init()
{
$settings = wptouch_get_settings('foundation');
if ($settings->typography_sets != 'default') {
wp_enqueue_script('foundation_google_fonts', foundation_get_base_module_url() . '/google-fonts/google-fonts.js', false, md5(FOUNDATION_VERSION), true);
add_filter('wptouch_body_classes', 'foundation_add_google_font_classes');
}
$selected_font_info = foundation_google_fonts_get_selected_info();
if ($selected_font_info) {
$family_string = '';
$inline_style_data = '';
if (is_array($selected_font_info) && count($selected_font_info)) {
$new_families = array();
foreach ($selected_font_info as $font_info) {
$font_string = htmlentities($font_info->name);
if (isset($font_info->variants) && is_array($font_info->variants)) {
$font_string .= ':' . implode(',', $font_info->variants);
}
$new_families[] = $font_string;
$inline_style_data .= "." . $font_info->selector . "-font" . " {\n";
$inline_style_data .= "\tfont-family: '" . $font_info->name . "', " . $font_info->fallback . ";\n";
$inline_style_data .= "}\n";
}
$family_string = implode('|', $new_families);
}
if ($family_string) {
wp_enqueue_style('foundation_google_fonts', 'http://fonts.googleapis.com/css?family=' . $family_string, false, FOUNDATION_VERSION, false);
if ($inline_style_data) {
wp_add_inline_style('foundation_google_fonts', $inline_style_data);
}
}
}
}
开发者ID:patrickmetzger,项目名称:adthrive-touch,代码行数:33,代码来源:google-fonts.php
示例13: front_end_styles
/**
* Append our customizer styles to the <head> whenever our main stylesheet is called.
*/
public function front_end_styles()
{
// Grab the styles that pertain to the front end, but don't wrap them in a style tag.
$styles = $this->get_inline_styles('unwrapped', 'front_end');
// Attach our customizer styles to our stylesheet. When it gets called, so do our customizer styles.
wp_add_inline_style(CSST_TMD, $styles);
}
开发者ID:scofennell,项目名称:csst-tmd,代码行数:10,代码来源:class.inline-styles.php
示例14: shoestrap_user_css
function shoestrap_user_css()
{
$header_scripts = shoestrap_getVariable('user_css');
if (trim($header_scripts) != '') {
wp_add_inline_style('ac-theme', $header_scripts);
}
}
开发者ID:Jhorton4,项目名称:Bohldfeys_Portfolio,代码行数:7,代码来源:functions.advanced.php
示例15: onetone_custom_scripts
function onetone_custom_scripts()
{
wp_enqueue_style('onetone-font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', false, '4.0.3', false);
wp_enqueue_style('onetone-main', get_stylesheet_uri(), array(), '1.2.8');
wp_enqueue_style('Yanone-Kaffeesatz', esc_url('//fonts.googleapis.com/css?family=Yanone+Kaffeesatz|Lustria|Raleway|Open+Sans:400,300'), false, '', false);
$background_array = onetone_options_array("page_background");
$background = onetone_get_background($background_array);
$header_image = get_header_image();
$onetone_custom_css = "";
if (isset($header_image) && !empty($header_image)) {
$onetone_custom_css .= ".home-header{background:url(" . $header_image . ") repeat;}\n";
}
if ('blank' != get_header_textcolor() && '' != get_header_textcolor()) {
$header_color = ' color:#' . get_header_textcolor() . ';';
$onetone_custom_css .= '.home-header,.site-name,.site-description{' . $header_color . '}';
}
$custom_css = onetone_options_array("custom_css");
$onetone_custom_css .= '.site{' . $background . '}';
$top_menu_font_color = onetone_options_array('font_color');
if ($top_menu_font_color != "" && $top_menu_font_color != null) {
$onetone_custom_css .= 'header #menu-main > li > a span,header .top-nav > ul > li > a span{color:' . $top_menu_font_color . '}';
}
$onetone_custom_css .= $custom_css;
wp_add_inline_style('onetone-main', $onetone_custom_css);
if (is_home()) {
wp_enqueue_script('onetone-bigvideo', get_template_directory_uri() . '/js/jquery.tubular.1.0.js', array('jquery'), '1.0', true);
}
wp_enqueue_script('onetone-modernizr', get_template_directory_uri() . '/js/modernizr.custom.js', array('jquery'), '2.8.2 ', false);
wp_enqueue_script('onetone-unslider', get_template_directory_uri() . '/js/unslider.js', array('jquery'), '1.0.0 ', true);
wp_enqueue_script('onetone-default', get_template_directory_uri() . '/js/onetone.js', array('jquery'), '1.2.8', true);
if (is_singular() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_localize_script('onetone-default', 'onetone_params', array('ajaxurl' => admin_url('admin-ajax.php'), 'themeurl' => get_template_directory_uri()));
}
开发者ID:Magnacarter,项目名称:livinghope.com,代码行数:35,代码来源:theme-setup.php
示例16: _register_actions
protected function _register_actions()
{
// render
add_action("{$this->_taxonomy}_add_form_fields", function ($tag) {
echo $this->render_new();
});
add_action("{$this->_taxonomy}_edit_form_fields", function ($tag) {
echo $this->render_edit($tag->term_id);
});
// save
$save_custom_fields_function = function ($term_id) {
$this->_save($term_id);
};
add_action("create_{$this->_taxonomy}", $save_custom_fields_function);
add_action("edited_{$this->_taxonomy}", $save_custom_fields_function);
// load assets
$enqueue_scripts_function = function () {
$this->get_field()->enqueue_javascript();
};
add_action('admin_print_scripts-edit-tags.php', $enqueue_scripts_function, 10);
add_action('admin_print_scripts-term.php', $enqueue_scripts_function, 10);
$enqueue_styles_function = function () {
$this->get_field()->enqueue_style();
wp_add_inline_style('wp-admin', $this->_style_fix());
};
add_action('admin_print_styles-edit-tags.php', $enqueue_styles_function);
add_action('admin_print_styles-term.php', $enqueue_styles_function);
}
开发者ID:redink-no,项目名称:wpkit,代码行数:28,代码来源:TaxonomyField.php
示例17: custom_css
/**
* Include the custom CSS
* Activate the custom CSS module.
*/
function custom_css()
{
$css = get_theme_mod('css', '');
if (!empty($css)) {
wp_add_inline_style('maera', $css);
}
}
开发者ID:wpmu,项目名称:maera-foundation,代码行数:11,代码来源:class-Maera_ZF_Styles.php
示例18: raindrops_jetpack_css
/**
*
* @since 1.247
*/
function raindrops_jetpack_css()
{
$raindrops_css = ' .jetpack-image-container img,
.jetpack-display-remote-posts img{
max-width:100%;
height:auto;
}
.embed-youtube{
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
}
.embed-youtube iframe,
.embed-youtube object,
.embed-youtube embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
min-width:160px;
}';
wp_add_inline_style('jetpack-widgets', $raindrops_css);
}
开发者ID:TheRojam,项目名称:raindrops,代码行数:29,代码来源:jetpack.php
示例19: ptshortcode
/**
*
* Function: ptshortcode.
* @return Shortcode main output in html
*
*/
public function ptshortcode($atts, $content = null)
{
extract(shortcode_atts(array("id" => "", "font_color" => "", "class" => ""), $atts));
$class_id = $style = $op = '';
/*** Class ID ***/
if (!empty($id)) {
$class_id = 'ts-ptshortcode-' . $id;
} else {
$rand = rand(1000, 9999);
$class_id = 'ts-ptshortcode-' . $rand;
}
/*** Content ***/
if (class_exists('TS_funcs')) {
$ts_funcs = new TS_funcs();
$content = $ts_funcs->removeautowrap($content);
}
do_shortcode($content);
/*** Custom Class ***/
$style = 'color: ' . $font_color . ';';
if (!empty($style)) {
$styleblock = '.' . $class_id . '{' . $style . '}';
if (class_exists('TS_funcs') && $ts_funcs->tste_settings['gn_theme_ajax'] === 'true') {
echo '<style id="style-' . $class_id . '" type="text/css">' . $styleblock . '</style>';
} else {
wp_enqueue_style($this->parent->_token . '-dummystyle');
wp_add_inline_style($this->parent->_token . '-dummystyle', $styleblock);
}
}
/*** Output ***/
$op = '<div class="' . $class_id . ' ' . $class . '">' . $content . '</div>';
return $op;
}
开发者ID:rezaps,项目名称:ripple-effect,代码行数:38,代码来源:tssc_ptshortcode.php
示例20: foundation_post_nav_background
/**
* Add featured image as background image to post navigation elements.
*
* @since Foundation Theme 0.5.0
*
* @see wp_add_inline_style()
*/
function foundation_post_nav_background()
{
if (!is_single()) {
return;
}
$previous = is_attachment() ? get_post(get_post()->post_parent) : get_adjacent_post(false, '', true);
$next = get_adjacent_post(false, '', false);
$css = '';
if (is_attachment() && 'attachment' == $previous->post_type) {
return;
}
if ($previous && has_post_thumbnail($previous->ID)) {
$prevthumb = wp_get_attachment_image_src(get_post_thumbnail_id($previous->ID), 'post-thumbnail');
$css .= '
.post-navigation .nav-previous { background-image: url(' . esc_url($prevthumb[0]) . '); }
.post-navigation .nav-previous .post-title, .post-navigation .nav-previous a:hover .post-title, .post-navigation .nav-previous .meta-nav { color: #fff; }
.post-navigation .nav-previous a:before { background-color: rgba(0, 0, 0, 0.4); }
';
}
if ($next && has_post_thumbnail($next->ID)) {
$nextthumb = wp_get_attachment_image_src(get_post_thumbnail_id($next->ID), 'post-thumbnail');
$css .= '
.post-navigation .nav-next { background-image: url(' . esc_url($nextthumb[0]) . '); border-top: 0; }
.post-navigation .nav-next .post-title, .post-navigation .nav-next a:hover .post-title, .post-navigation .nav-next .meta-nav { color: #fff; }
.post-navigation .nav-next a:before { background-color: rgba(0, 0, 0, 0.4); }
';
}
wp_add_inline_style('main-stylesheet', $css);
}
开发者ID:adam1920,项目名称:FoundationTheme,代码行数:36,代码来源:posts_navigation.php
注:本文中的wp_add_inline_style函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论