本文整理汇总了PHP中responsive_get_options函数的典型用法代码示例。如果您正苦于以下问题:PHP responsive_get_options函数的具体用法?PHP responsive_get_options怎么用?PHP responsive_get_options使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了responsive_get_options函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: responsive_update_social_icon_options
function responsive_update_social_icon_options()
{
$responsive_options = responsive_get_options();
// If new option does not exist then copy the option
if (!isset($responsive_options['googleplus_uid'])) {
$responsive_options['googleplus_uid'] = $responsive_options['google_plus_uid'];
}
if (!isset($responsive_options['stumbleupon_uid'])) {
$responsive_options['stumbleupon_uid'] = $responsive_options['stumble_uid'];
}
// Update entire array
update_option('responsive_theme_options', $responsive_options);
}
示例2: responsive_css
function responsive_css()
{
$theme = wp_get_theme();
$responsive = wp_get_theme('responsive');
$responsive_options = responsive_get_options();
if (1 == $responsive_options['minified_css']) {
wp_enqueue_style('responsive-style', get_template_directory_uri() . '/core/css/style.min.css', false, $responsive['Version']);
} else {
wp_enqueue_style('responsive-style', get_template_directory_uri() . '/core/css/style.css', false, $responsive['Version']);
wp_enqueue_style('responsive-media-queries', get_template_directory_uri() . '/core/css/responsive.css', false, $responsive['Version']);
}
if (is_rtl()) {
wp_enqueue_style('responsive-rtl-style', get_template_directory_uri() . '/rtl.css', false, $responsive['Version']);
}
if (is_child_theme()) {
wp_enqueue_style('responsive-child-style', get_stylesheet_uri(), false, $theme['Version']);
}
}
示例3: responsive_get_layout
/**
* Get current layout
*/
function responsive_get_layout()
{
/* 404 pages */
if (is_404()) {
return 'default';
}
$layout = '';
/* Get Theme options */
global $responsive_options;
$responsive_options = responsive_get_options();
/* Get valid layouts */
$valid_layouts = responsive_get_valid_layouts();
/* For singular pages, get post meta */
if (is_singular()) {
global $post;
$layout_meta_value = false != get_post_meta($post->ID, '_responsive_layout', true) ? get_post_meta($post->ID, '_responsive_layout', true) : 'default';
$layout_meta = array_key_exists($layout_meta_value, $valid_layouts) ? $layout_meta_value : 'default';
}
/* Static pages */
if (is_page()) {
$page_template = get_post_meta($post->ID, '_wp_page_template', true);
/* If custom page template is defined, use it first */
if ('default' != $page_template) {
if (in_array($page_template, array('blog.php', 'blog-excerpt.php'))) {
$layout = $responsive_options['blog_posts_index_layout_default'];
} else {
$layout = $responsive_options['static_page_layout_default'];
}
} else {
if ('default' != $layout_meta) {
$layout = $layout_meta;
} else {
$layout = $responsive_options['static_page_layout_default'];
}
}
} else {
if (is_single()) {
/* If post custom meta is set, use it */
if ('default' != $layout_meta) {
$layout = $layout_meta;
} else {
$layout = $responsive_options['single_post_layout_default'];
}
} else {
if (is_home() || is_archive() || is_search()) {
$layout = $responsive_options['blog_posts_index_layout_default'];
} else {
$layout = 'default';
}
}
}
return apply_filters('responsive_get_layout', $layout);
}
示例4: responsive_front_page_reading_notice
function responsive_front_page_reading_notice()
{
$screen = get_current_screen();
$responsive_options = responsive_get_options();
if ('options-reading' == $screen->id) {
$html = '<div class="updated">';
if (1 == $responsive_options['front_page']) {
$html .= '<p>' . sprintf(__('The Custom Front Page is enabled. You can disable it in the <a href="%1$s">theme settings</a>.', 'responsive'), admin_url('themes.php?page=theme_options')) . '</p>';
} else {
$html .= '<p>' . sprintf(__('The Custom Front Page is disabled. You can enable it in the <a href="%1$s">theme settings</a>.', 'responsive'), admin_url('themes.php?page=theme_options')) . '</p>';
}
$html .= '</div>';
echo $html;
}
}
示例5: responsive_get_social_icons
function responsive_get_social_icons()
{
$responsive_options = responsive_get_options();
$sites = array('twitter' => __('Twitter', 'responsive'), 'facebook' => __('Facebook', 'responsive'), 'linkedin' => __('LinkedIn', 'responsive'), 'youtube' => __('YouTube', 'responsive'), 'stumbleupon' => __('StumbleUpon', 'responsive'), 'rss' => __('RSS Feed', 'responsive'), 'googleplus' => __('Google+', 'responsive'), 'instagram' => __('Instagram', 'responsive'), 'pinterest' => __('Pinterest', 'responsive'), 'yelp' => __('Yelp!', 'responsive'), 'vimeo' => __('Vimeo', 'responsive'), 'foursquare' => __('foursquare', 'responsive'));
$html = '<ul class="social-icons">';
foreach ($sites as $key => $value) {
if (!empty($responsive_options[$key . '_uid'])) {
$html .= '<li class="' . esc_attr($key) . '-icon"><a href="' . $responsive_options[$key . '_uid'] . '">' . '<img src="' . responsive_child_uri('/core/icons/' . esc_attr($key) . '-icon.png') . '" width="24" height="24" alt="' . esc_html($value) . '">' . '</a></li>';
}
}
$html .= '</ul><!-- .social-icons -->';
return $html;
}
示例6: responsive_customize_styles
function responsive_customize_styles()
{
// get the options
$responsive_options = responsive_get_options();
// set the variables
$font_size = get_theme_mod('responsive_font_size');
$heading_color = get_theme_mod('responsive_heading_colorpicker');
$text_color = get_theme_mod('responsive_text_colorpicker');
$link_color = get_theme_mod('responsive_link_colorpicker');
$link_hover_color = get_theme_mod('responsive_link_hover_colorpicker');
$menu_gradients_checkbox = get_theme_mod('responsive_menu_gradients_checkbox');
$menu_background_color = get_theme_mod('responsive_menu_background_colorpicker');
$menu_background_color_2 = get_theme_mod('responsive_menu_background_colorpicker_2');
$menu_background_color_2 = $menu_gradients_checkbox == 1 & $menu_background_color_2 != '' ? $menu_background_color_2 : $menu_background_color;
$menu_text_color = get_theme_mod('responsive_menu_text_colorpicker');
$menu_text_hover_color = get_theme_mod('responsive_menu_text_hover_colorpicker');
$menu_item_color = get_theme_mod('responsive_menu_item_colorpicker');
$menu_item_hover_color = get_theme_mod('responsive_menu_item_hover_colorpicker');
$font_heading = get_theme_mod('responsive_font_heading');
$google_font_heading = get_theme_mod('responsive_google_font_heading') != '' ? responsive_google_font(get_theme_mod('responsive_google_font_heading')) : '';
$font_text = get_theme_mod('responsive_font_text');
$google_font_text = get_theme_mod('responsive_google_font_text') != '' ? responsive_google_font(get_theme_mod('responsive_google_font_text')) : '';
// create a string to add to the google font stylesheet call
$google_param = $google_font_heading != '' ? $google_font_heading['param'] : '';
$google_param .= $google_font_heading != '' && $google_font_text != '' ? '|' : '';
$google_param .= $google_font_text != '' ? $google_font_text['param'] : '';
if ($google_font_heading != '' && $font_heading == 'google' || $google_font_text != '' && $font_text == 'google') {
?>
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=<?php
echo $google_param;
?>
">
<?php
}
?>
<style type="text/css" id="customizer_styles">
<?php
/**
* Body styles
*/
?>
body {
<?php
if ($text_color != '') {
?>
color: <?php
echo esc_html($text_color);
?>
;
<?php
}
if ($font_text != 'google') {
?>
font-family: <?php
echo esc_html($font_text);
?>
;
<?php
} elseif ($google_font_text != '') {
?>
font-family: '<?php
echo esc_html($google_font_text['font']);
?>
';
<?php
}
if ($font_size != '') {
?>
font-size: <?php
echo absint($font_size);
?>
px;
<?php
}
?>
}
<?php
/**
* Heading styles
*/
if ($heading_color != '' || $google_font_heading != '' || $font_heading != '') {
?>
h1, h2, h3, h4, h5, h6, .widget-title h3 {
<?php
if ($heading_color != '') {
?>
color: <?php
echo esc_html($heading_color);
?>
;
<?php
}
if ($font_heading != 'google') {
?>
font-family: <?php
echo esc_html($font_heading);
?>
;
<?php
//.........这里部分代码省略.........
示例7: responsive_get_options
<?php
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
}
$responsive_options = responsive_get_options();
//test for first install no database
$db = get_option('responsive_theme_options');
//test if all options are empty so we can display default text if they are
$empty = empty($responsive_options['home_headline']) && empty($responsive_options['home_subheadline']) && empty($responsive_options['home_content_area']) ? false : true;
$emtpy_cta = empty($responsive_options['cta_text']) ? false : true;
?>
<div id="featured" class="grid col-940">
<div id="featured-content" class="grid col-460">
<h1 class="featured-title">
<?php
if (isset($responsive_options['home_headline']) && $db && $empty) {
echo $responsive_options['home_headline'];
} else {
_e('Hello, World!', 'responsive');
}
?>
</h1>
<h2 class="featured-subtitle">
<?php
if (isset($responsive_options['home_subheadline']) && $db && $empty) {