• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP get_custom_option函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_custom_option函数的典型用法代码示例。如果您正苦于以下问题:PHP get_custom_option函数的具体用法?PHP get_custom_option怎么用?PHP get_custom_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_custom_option函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: woocommerce_output_related_products

function woocommerce_output_related_products()
{
    if (($ppp = max(3, get_custom_option('post_related_count'))) > 0) {
        woocommerce_related_products($ppp, 3);
    }
}
开发者ID:eq0rip,项目名称:Hamroreview.com,代码行数:6,代码来源:functions.php


示例2: sc_clear_around

function sc_clear_around($content)
{
    $content = str_replace("\r\n", "\n", $content);
    //$content = preg_replace("/\](\s|\n)*\[/", "][", $content);
    $content = get_custom_option('clear_shortcodes') == 'no' ? preg_replace("/\\](\\s|\n)*\\[/", "][", $content) : preg_replace(array("/\\](\\s|\n|<p>|<\\/p>|<br>|<br\\/>|<br \\/>)+/", "/(\\s|\n|<p>|<\\/p>|<br>|<br\\/>|<br \\/>)+\\[/"), array("] ", " ["), $content);
    return $content;
}
开发者ID:amankatoch,项目名称:wp-plugin,代码行数:7,代码来源:shortcodes_settings.php


示例3: trex_related_poducts_args

function trex_related_poducts_args($args)
{
    $show_sidebar_main = in_array(get_custom_option('show_sidebar_main'), array('left', 'right')) ? true : false;
    if ($show_sidebar_main) {
        $args['posts_per_page'] = 3;
    } else {
        $args['posts_per_page'] = 3;
    }
    $args['columns'] = 3;
    return $args;
}
开发者ID:nickandersonr,项目名称:FriedMagazine,代码行数:11,代码来源:woo-functions.php


示例4: widget

    /**
     * How to display the widget on the screen.
     */
    function widget($args, $instance)
    {
        extract($args);
        /* Our variables from the widget settings. */
        $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '');
        $advert_image = isset($instance['advert_image']) ? $instance['advert_image'] : '';
        $advert_link = isset($instance['advert_link']) ? $instance['advert_link'] : '';
        $advert_code = isset($instance['advert_code']) ? $instance['advert_code'] : '';
        /* Before widget (defined by themes). */
        echo $before_widget;
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>
			
		<div class="widget_advert_inner">
			<?php 
        if ($advert_image != '') {
            echo ($advert_link != '' ? '<a href="' . $advert_link . '" class="image_wrapper">' : '') . '<img src="' . $advert_image . '" border="0" alt="' . $title . '" />' . ($advert_link != '' ? '</a>' : '');
        }
        if ($advert_code != '') {
            if (get_custom_option('substitute_gallery') == 'yes') {
                $advert_code = substituteGallery($advert_code, 0, 275, 200);
            }
            $advert_code = do_shortcode($advert_code);
            if (get_custom_option('substitute_video') == 'yes') {
                $advert_code = substituteVideo($advert_code, 275, 200);
            }
            if (get_custom_option('substitute_audio') == 'yes') {
                $advert_code = substituteAudio($advert_code);
            }
            echo $advert_code;
        }
        ?>
		</div>
<?php 
        /* After widget (defined by themes). */
        echo $after_widget;
    }
开发者ID:eq0rip,项目名称:Hamroreview.com,代码行数:42,代码来源:widget-advert.php


示例5: getPostShare

 function getPostShare($arg, $post_data)
 {
     $side_bar = get_custom_option('show_sidebar_main');
     if (sc_param_is_on(get_custom_option('show_post_info', null, $post_data['post_id'])) && !is_single()) {
         $array_info = explode(',', $arg);
         $array_list = array();
         if ($side_bar != "wide") {
             $array_list['views'] = '<div class="postSpan postViews"><span class="icon icon-eye"></span><a href="' . $post_data['post_link'] . '" class="revInfo">' . $post_data['post_views'] . '</a></div>';
             $array_list['likes'] = '<div class="postSpan postLikes likeButton like" data-postid="' . $post_data['post_id'] . '" data-likes="' . $post_data['post_likes'] . '"><span class="icon icon-heart"></span><a href="" class="revInfo">' . $post_data['post_likes'] . '</a></div>';
             $array_list['more'] = $post_data['post_link'] ? '<div class="postSpan postMore"><span class="icon icon-link"></span><a href="' . $post_data['post_link'] . '"  class="revInfo">' . __('More ', 'themerex') . '</a></div>' : '';
             //review
             if ($post_data['post_reviews_author'] && sc_param_is_on(get_custom_option('show_reviews', null, $post_data['post_id']))) {
                 $avg_author = $post_data['post_reviews_' . (get_theme_option('reviews_first') == 'author' ? 'author' : 'users')];
                 $rating_max = get_custom_option('reviews_max_level');
                 $array_list['reviews'] = '<div class="postSpan postReview" title="' . sprintf(__('Rating - %s/%s', 'themerex'), $avg_author, $rating_max) . '"><span class="icon icon-star"></span><a href="' . $post_data['post_link'] . '" class="revInfo">' . getReviewsSummaryStarsSharing($avg_author, false, false) . '</a></div>';
             }
         }
         $array_list['comments'] = '<div class="postSpan postComment"><span class="icon icon-post"></span><a href="' . $post_data['post_comments_link'] . '" class="revInfo">' . $post_data['post_comments'] . ($side_bar == 'wide' ? ' comments' : '') . '</a></div>';
         $post_share = showShareButtons(array("post_id" => $post_data["post_id"], "post_link" => $post_data["post_link"], "post_title" => $post_data["post_title"], "post_descr" => strip_tags($post_data["post_excerpt"]), "post_thumb" => $post_data["post_attachment"], "style" => "drop", "echo" => false));
         if ($side_bar != "wide") {
             $array_list['share'] = '<div class="postSpan postShare share"><span class="icon icon-share"></span><a class="revInfo shareDrop" href="#">' . __('Share ', 'themerex') . '</a>' . $post_share . '</div>';
         } else {
             $array_list['share'] = '<div class="postSpan postShare share">' . $post_share . '</div>';
         }
         $post_info_html = '';
         foreach ($array_info as $array_infos) {
             foreach ($array_list as $k => $val) {
                 if ($k == $array_infos) {
                     $post_info_html .= $val;
                 }
             }
         }
         if ($post_info_html != '') {
             return '<div class="postSharing hoverUnderline">' . $post_info_html . '</div>';
         } else {
             return '';
         }
     }
 }
开发者ID:riaface,项目名称:GrowBeyond,代码行数:39,代码来源:page-part-postinfo.php


示例6: marksToDisplay

 function marksToDisplay($marks)
 {
     $maxLevel = max(5, (int) get_custom_option('reviews_max_level'));
     if ($maxLevel == 100) {
         return $marks;
     }
     $m = explode(',', $marks);
     $kol = count($m);
     for ($i = 0; $i < $kol; $i++) {
         $m[$i] = round($m[$i] / 100 * $maxLevel, 1);
     }
     return implode(',', $m);
 }
开发者ID:riaface,项目名称:GrowBeyond,代码行数:13,代码来源:type-reviews.php


示例7: get_header

<?php

/*
Template Name: Attachment page
*/
get_header();
$counters = get_theme_option("blog_counters");
$blog_style = 'fullpost';
//get_custom_option('blog_style');
while (have_posts()) {
    the_post();
    // Move setPostViews to the javascript - counter will work under cache system
    if (get_theme_option('use_ajax_views_counter') == 'no') {
        setPostViews(get_the_ID());
    }
    showPostLayout(array('layout' => 'attachment', 'thumb_size' => $blog_style, 'sidebar' => !in_array(get_custom_option('show_sidebar_main'), array('none', 'fullwidth')), 'categories_list' => false, 'tags_list' => false));
}
get_footer();
开发者ID:riaface,项目名称:GrowBeyond,代码行数:18,代码来源:attachment.php


示例8: showShareButtons

function showShareButtons($post_data)
{
    if (get_custom_option('show_share') == 'yes') {
        $socials = get_theme_option('share_buttons');
        $arr = explode(',', $socials);
        $list = array();
        foreach ($arr as $s) {
            if (empty($s)) {
                continue;
            }
            $s = explode('|', $s);
            //if (count($s)!=3 || empty($s[0])) continue;
            if (count($s) != 3) {
                continue;
            }
            $list[$s[2]] = array('url' => $s[0]);
        }
        if (count($list) > 0) {
            ?>
			<div class="post_info post_info_bottom theme_text">
				<?php 
            showShareSocialLinks(array('post_id' => $post_data['post_id'], 'post_link' => $post_data['post_link'], 'post_title' => $post_data['post_title'], 'post_descr' => $post_data['post_descr'], 'post_thumb' => $post_data['post_thumb'], 'caption' => get_theme_option('share_caption'), 'share' => $list, 'counters' => get_theme_option('show_share_counters') == 'yes', 'direction' => get_custom_option('body_style') == 'fullwidth' ? 'horizontal' : get_theme_option('share_direction')));
            ?>
			</div>
			<?php 
        }
    }
}
开发者ID:eq0rip,项目名称:Hamroreview.com,代码行数:28,代码来源:_wp_utils.php


示例9: themerex_strtoproper

        echo $post_data['post_categories_links'];
        ?>
</span>
					<?php 
    }
    ?>
				</div>
			</div>
		</div>
	</article>
<?php 
} else {
    $dir = themerex_strtoproper(get_custom_option('hover_style', null, $post_data['post_id']));
    ?>
	<article class="isotopeElement <?php 
    echo 'post_format_' . $post_data['post_format'] . 'hover_' . $dir . ($dir == 'Book' ? ' bookShowWrap' : '') . ($opt['number'] % 2 == 0 ? ' even' : ' odd') . ($opt['number'] == 0 ? ' first' : '') . ($opt['number'] == $opt['posts_on_page'] ? ' last' : '') . ($opt['add_view_more'] ? ' viewmore' : '') . (get_custom_option('show_filters') == 'yes' ? ' flt_' . join(' flt_', get_custom_option('filter_taxonomy') == 'categories' ? $post_data['post_categories_ids'] : $post_data['post_tags_ids']) : '');
    ?>
">
		<div class="hover hover<?php 
    echo $dir;
    ?>
Show">
			<?php 
    if ($post_data['post_thumb']) {
        ?>
				<div class="thumb"><?php 
        echo $post_data['post_thumb'];
        ?>
</div>
			<?php 
    } else {
开发者ID:nickandersonr,项目名称:FriedMagazine,代码行数:31,代码来源:post-layout-portfol.php


示例10: addSortOrderInQuery

            }
        }
    }
    $args = addSortOrderInQuery($args);
    query_posts($args);
    $wp_query_need_restore = true;
}
$per_page = count($wp_query->posts);
$post_number = 0;
/*
global $more;
$oldmore = $more;
$more = 0;
*/
$addViewMoreClass = false;
$parent_cat_id = (int) get_custom_option('category_id');
while (have_posts()) {
    the_post();
    require get_template_directory() . '/template-blog-loop.php';
}
// $more = $oldmore;
if (!$post_number) {
    if (is_404()) {
        require get_template_directory() . '/template-blog-404.php';
    } else {
        if (is_search()) {
            require get_template_directory() . '/template-blog-no-search-results.php';
        } else {
            require get_template_directory() . '/template-blog-no-articles.php';
        }
    }
开发者ID:eq0rip,项目名称:Hamroreview.com,代码行数:31,代码来源:template-blog.php


示例11: get_custom_option

	
	
	<div class="article_wrap">
	<?php 
if (!in_array($post_data['post_format'], array('chat', 'link', 'status', 'quote'))) {
    ?>
	<header class="post_info infoPost">
		<?php 
    $excerpt_length = get_custom_option('post_excerpt_maxlength');
    /* Reviews */
    $review_type = get_custom_option('reviews_first');
    $review_avg = $post_data['post_reviews_' . $review_type];
    $review_first = get_custom_option('reviews_first');
    $review_max = get_custom_option('reviews_max_level', '', $post_data['post_id']);
    $review_style = get_custom_option('reviews_style', '', $post_data['post_id']);
    $review_color = get_custom_option('review_color', '', $post_data['post_id']);
    if (!empty($review_avg) && !strpos($review_style, 'stars') !== false) {
        echo get_review_rating($review_style, $review_avg, $review_max, $review_color);
    }
    /* /Reviews */
    if ($show_title) {
        ?>
		<h2 class="post_title"><a href="<?php 
        echo $post_data['post_link'];
        ?>
"><?php 
        echo $post_data['post_title'];
        ?>
</a></h2>
		<?php 
        if (!empty($review_avg) && strpos($review_style, 'stars') !== false) {
开发者ID:nickandersonr,项目名称:FriedMagazine,代码行数:29,代码来源:post-layout-masonry.php


示例12: array

    ?>

					<?php 
    if (get_custom_option('show_post_counters') == 'yes') {
        ?>
						<div class="postSharing">
							<?php 
        $postinfo_buttons = array('comments', 'views', 'likes', 'share', 'markup');
        require themerex_get_file_dir('/templates/page-part-postinfo.php');
        ?>
						</div>
					<?php 
    }
    ?>
					<?php 
    if (get_custom_option('show_post_tags') == 'yes' && $post_data['post_tags_links'] != '') {
        ?>
						<div class="post_tags">
							<?php 
        _e('Tags:', 'themerex');
        ?>
							<?php 
        echo balanceTags($post_data['post_tags_links']);
        ?>
						</div>
					<?php 
    }
    ?>
				</div>

			<?php 
开发者ID:WestBayResidential,项目名称:wbrsorg,代码行数:31,代码来源:post-layout-single-portfolio.php


示例13: get_custom_option

            }
        }
    }
    ?>
                    </div>
                </div>
			<?php 
}
?>

			<?php 
if (get_custom_option('googlemap_show') == 'yes') {
    $map_display = get_custom_option('googlemap_display');
    $map_height = get_custom_option('googlemap_height');
    $map_address = get_custom_option('googlemap_address');
    $map_latlng = get_custom_option('googlemap_latlng');
    if (!empty($map_address) || !empty($map_latlng)) {
        ?>
					<div id="main_map" class="main_map_<?php 
        echo $map_display;
        ?>
">
						<div id="main_map_inner">
							<?php 
        echo do_shortcode("[googlemap " . (!empty($map_latlng) ? "latlng='{$map_latlng}'" : "address='{$map_address}'") . " zoom='" . get_custom_option('googlemap_zoom') . "' width='100%' height='{$map_height}']");
        ?>
						</div>
					</div>
			<?php 
    }
}
开发者ID:eq0rip,项目名称:Hamroreview.com,代码行数:31,代码来源:header.php


示例14: get_custom_option

        ?>
/images/slider/slide3_2.png" data-rsw="707" data-rsh="471">
			
					</div>
				</div>
				<?php 
    } else {
        if ($slider == 'flex' || $slider == 'swiper') {
            $slider_cat = get_custom_option("slider_category");
            $slider_orderby = get_custom_option("slider_orderby");
            $slider_order = get_custom_option("slider_order");
            $slider_count = $slider_ids = get_custom_option("slider_posts");
            if (themerex_strpos($slider_ids, ',') !== false) {
                $slider_count = 0;
            } else {
                $slider_ids = '';
                if (empty($slider_count)) {
                    $slider_count = 3;
                }
            }
            $slider_info_box = get_custom_option("slider_info_box");
            $slider_info_fixed = get_custom_option("slider_info_fixed");
            if ($slider_count > 0 || !empty($slider_ids)) {
                echo do_shortcode('[slider engine="' . $slider . '" controls="0"' . ($slider_cat ? ' cat="' . $slider_cat . '"' : '') . ($slider_ids ? ' ids="' . $slider_ids . '"' : '') . ($slider_count ? ' count="' . $slider_count . '"' : '') . ($slider_orderby ? ' orderby="' . $slider_orderby . '"' : '') . ($slider_order ? ' order="' . $slider_order . '"' : '') . ' titles="' . ($slider_info_box == 'yes' ? $slider_info_fixed == 'yes' ? 2 : 1 : 0) . '"' . ']');
            }
        }
    }
    ?>
	</div>
<?php 
}
开发者ID:nickandersonr,项目名称:FriedMagazine,代码行数:31,代码来源:page-part-slider.php


示例15: getReviewsSummaryStars

<?php

$post_title_tag = $opt['style'] == 'list' ? 'li' : 'h4';
$reviewsBlock = '';
if (!in_array($opt['style'], array('accordion_1', 'accordion_2', 'accordion_3', 'list')) && $opt['reviews'] && get_custom_option('show_reviews', null, $post_data['post_id']) == 'yes') {
    $avg_author = $post_data['post_reviews_' . (get_theme_option('reviews_first') == 'author' ? 'author' : 'users')];
    if ($avg_author > 0) {
        $reviewsBlock .= '<div class="reviews_summary blog_reviews">' . '<div class="criteria_summary criteria_row">' . getReviewsSummaryStars($avg_author) . '</div>' . '</div>';
    }
}
$title = '<' . $post_title_tag . ' class="sc_blogger_title sc_title' . (in_array($opt['style'], array('accordion_1', 'accordion_2', 'accordion_3')) ? ' sc_toggl_title' : '') . '">' . (in_array($opt['style'], array('accordion_1', 'accordion_2', 'accordion_3')) ? '' : '<a href="' . $post_data['post_link'] . '">') . $post_data['post_title'] . (in_array($opt['style'], array('accordion_1', 'accordion_2', 'accordion_3')) ? '' : '</a>') . '</' . $post_title_tag . '>';
$thumb = $post_data['post_thumb'] && themerex_strpos($opt['style'], 'image') !== false ? '<div class="thumb">' . ($post_data['post_link'] != '' ? '<a href="' . $post_data['post_link'] . '">' . $post_data['post_thumb'] . '</a>' : $post_data['post_thumb']) . '</div>' : '';
$info = sc_param_is_on($opt['info']) ? '<div class="sc_blogger_info">' . (themerex_strpos($opt['style'], 'image') !== false || themerex_strpos($opt['style'], 'accordion') !== false ? '<div class="sc_blogger_author">' . __('Posted by', 'themerex') : __('by', 'themerex')) . ' <a href="' . $post_data['post_author_url'] . '" class="post_author">' . $post_data['post_author'] . '</a>' . ($opt['counters'] != 'none' ? ' <span class="separator">|</span> ' . ($opt['orderby'] == 'comments' || $opt['counters'] == 'comments' ? __('Comments', 'themerex') : __('Views', 'themerex')) . ' <span class="comments_number">' . ($opt['orderby'] == 'comments' || $opt['counters'] == 'comments' ? $post_data['post_comments'] : $post_data['post_views']) . '</span>' : '') . (themerex_strpos($opt['style'], 'image') !== false || themerex_strpos($opt['style'], 'accordion') !== false ? '</div>' . do_shortcode('[trx_button link="' . $post_data['post_link'] . '" skin="regular" size="mini"]' . ($opt['readmore'] ? $opt['readmore'] : __('More', 'themerex')) . '[/trx_button]') : '') . '</div>' : '';
if ($opt['style'] == 'list') {
    echo balanceTags($title);
} else {
    if ($opt['dir'] == 'horizontal') {
        ?>
		<div class="sc_columns_item column_item_<?php 
        echo esc_attr($opt['number']);
        echo ($opt['number'] % 2 == 1 ? ' odd' : ' even') . ($opt['number'] == 1 ? ' first' : '') . ($opt['number'] == $opt['posts_on_page'] ? ' last' : '') . (sc_param_is_on($opt['scroll']) ? ' sc_scroll_slide swiper-slide' : '');
        ?>
">

		<?php 
    }
    ?>
<article class="sc_blogger_item <?php 
    echo (in_array($opt['style'], array('accordion_1', 'accordion_2', 'accordion_3')) ? ' sc_toggl_item' : '') . ($opt['number'] == $opt['posts_on_page'] ? ' sc_blogger_item_last' : '') . (sc_param_is_on($opt['scroll']) && ($opt['dir'] == 'vertical' || $opt['style'] == 'date') ? ' sc_scroll_slide swiper-slide' : '');
    ?>
">
开发者ID:riaface,项目名称:GrowBeyond,代码行数:31,代码来源:post-layout-blogger.php


示例16: themerex_get_file_dir

</h1>
				<?php 
}
require themerex_get_file_dir('/templates/page-part-reviews-block.php');
startWrapper('<div class="post_text_area" itemprop="' . ($avg_author > 0 || $avg_users > 0 ? 'reviewBody' : 'articleBody') . '">');
// Post content
if ($post_data['post_protected']) {
    echo $post_data['post_excerpt'];
} else {
    echo sc_gap_wrapper($post_data['post_content']);
    wp_link_pages(array('before' => '<div class="nav_pages_parts"><span class="pages">' . __('Pages:', 'themerex') . '</span>', 'after' => '</div>', 'link_before' => '<span class="page_num">', 'link_after' => '</span>'));
    if (get_custom_option('show_post_info') == 'yes') {
        ?>
					<div class="itemInfo">
						<?php 
        if (get_custom_option('show_post_counters') == 'yes') {
            ?>
							<div class="postSharing">
								<?php 
            $postinfo_buttons = array('comments', 'views', 'likes', 'share', 'rating');
            require themerex_get_file_dir('/templates/page-part-postinfo.php');
            ?>
							</div>
						<?php 
        }
        ?>
						<div class="post_info infoPost">
							<?php 
        _e('Posted ', 'themerex');
        ?>
<a href="<?php 
开发者ID:derwegas,项目名称:strubbelkinder,代码行数:31,代码来源:post-layout-single-portfolio.php


示例17: is_user_logged_in

var THEMEREX_userLoggedIn = <?php 
echo is_user_logged_in() ? 'true' : 'false';
?>
;

// Show table of content for the current page
var THEMEREX_menu_toc = '<?php 
echo get_custom_option('menu_toc');
?>
';
var THEMEREX_menu_toc_home = THEMEREX_menu_toc!='no' && <?php 
echo get_custom_option('menu_toc_home') == 'yes' ? 'true' : 'false';
?>
;
var THEMEREX_menu_toc_top = THEMEREX_menu_toc!='no' && <?php 
echo get_custom_option('menu_toc_top') == 'yes' ? 'true' : 'false';
?>
;

// Fix main menu
var THEMEREX_menuFixed = <?php 
echo get_theme_option('menu_position') == 'fixed' ? 'true' : 'false';
?>
;

// Use responsive version for main menu
var THEMEREX_menuResponsive = <?php 
echo max(0, (int) get_theme_option('menu_responsive'));
?>
;
var THEMEREX_responsive_menu_click = <?php 
开发者ID:derwegas,项目名称:strubbelkinder,代码行数:31,代码来源:page-part-js-messages.php


示例18: _e

}
?>
	<!-- <a href="#" class="scrollToTop icon-up-open-big" title="<?php 
_e('Back to top', 'themerex');
?>
"></a> -->
</div>

<div class="customHtmlSection">
<?php 
echo get_custom_option('custom_code');
?>
</div>

<?php 
echo get_custom_option('gtm_code2');
?>
<script src="<?php 
echo get_stylesheet_directory_uri();
?>
/scripts/lib/unslider.min.js"></script>
<script src="<?php 
echo get_stylesheet_directory_uri();
?>
/scripts/scripts.js"></script>
<?php 
wp_footer();
?>

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
开发者ID:ccasad,项目名称:cscwp,代码行数:31,代码来源:footer.php


示例19: prepareThemeCustomStyles

function prepareThemeCustomStyles()
{
    // Custom fonts
    if (get_custom_option('typography_custom') == 'yes') {
        $s = '';
        $fonts = getThemeFontsList(false);
        $fname = get_custom_option('typography_p_font');
        if (isset($fonts[$fname])) {
            $fstyle = explode(',', get_custom_option('typography_p_style'));
            $fname2 = ($pos = themerex_strpos($fname, ' (')) !== false ? themerex_substr($fname, 0, $pos) : $fname;
            $i = in_array('i', $fstyle);
            $u = in_array('u', $fstyle);
            $c = get_custom_option('typography_p_color');
            $s .= "\n\t\t\t\tbody, button, input, select, textarea {\n\t\t\t\t\tfont-family: '" . $fname2 . "'" . (isset($fonts[$fname]['family']) ? ", " . $fonts[$fname]['family'] : '') . ";\n\t\t\t\t}\n\t\t\t\tbody {\n\t\t\t\t\tfont-size: " . get_custom_option('typography_p_size') . "px;\n\t\t\t\t\tfont-weight: " . get_custom_option('typography_p_weight') . ";\n\t\t\t\t\tline-height: " . get_custom_option('typography_p_lineheight') . "px;\n\t\t\t\t\t" . ($c ? "color: " . $c . ";" : '') . "\n\t\t\t\t\t" . ($i ? "font-style: italic;" : '') . "\n\t\t\t\t\t" . ($u ? "text-decoration: underline;" : '') . "\n\t\t\t\t}\n\t\t\t";
        }
        for ($h = 1; $h <= 6; $h++) {
            $fname = get_custom_option('typography_h' . $h . '_font');
            if (isset($fonts[$fname])) {
                $fstyle = explode(',', get_custom_option('typography_h' . $h . '_style'));
                $fname2 = ($pos = themerex_strpos($fname, ' (')) !== false ? themerex_substr($fname, 0, $pos) : $fname;
                $i = in_array('i', $fstyle);
                $u = in_array('u', $fstyle);
                $c = get_custom_option('typography_h' . $h . '_color');
                $s .= "\n\t\t\t\t\th" . $h . ", .h" . $h . " {\n\t\t\t\t\t\tfont-family: '" . $fname2 . "'" . (isset($fonts[$fname]['family']) ? ", " . $fonts[$fname]['family'] : '') . ";\n\t\t\t\t\t\tfont-size: " . get_custom_option('typography_h' . $h . '_size') . "px;\n\t\t\t\t\t\tfont-weight: " . get_custom_option('typography_h' . $h . '_weight') . ";\n\t\t\t\t\t\tline-height: " . get_custom_option('typography_h' . $h . '_lineheight') . "px;\n\t\t\t\t\t\t" . ($c ? "color: " . $c . ";" : '') . "\n\t\t\t\t\t\t" . ($i ? "font-style: italic;" : '') . "\n\t\t\t\t\t\t" . ($u ? "text-decoration: underline;" : '') . "\n\t\t\t\t\t}\n\t\t\t\t\th" . $h . " a, .h" . $h . " a {\n\t\t\t\t\t\t" . ($c ? "color: " . $c . ";" : '') . "\n\t\t\t\t\t}\n\t\t\t\t";
            }
        }
        if (!empty($s)) {
            addThemeCustomStyle($s);
        }
    }
    // Submenu width
    $menu_width = (int) get_theme_option('menu_width');
    if ($menu_width > 50) {
        addThemeCustomStyle("\n\t\t\t.topWrap .topMenuStyleLine > ul > li ul {\n\t\t\t\twidth: {$menu_width}px;\n\t\t\t}\n\t\t\t.topWrap .topMenuStyleLine > ul > li ul li ul {\n\t\t\t\tleft: " . ($menu_width + 31) . "px;\n\t\t\t}\n\t\t\t.menu_right .topWrap .topMenuStyleLine ul.submenu_left {\n\t\t\t\tleft: -" . ($menu_width + 91) . "px !important;\n\t\t\t}\n\t\t\tul#mainmenu .menu-panel ul.columns > li ul {\n\t\t\t\tmax-width: " . $menu_width . "px;\n\t\t\t}\n\n\t\t");
    }
    // Logo height
    $logo_height = (int) get_custom_option('logo_height');
    $logo_offset = (int) get_custom_option('logo_offset');
    if ($logo_height > 10) {
        if (empty($logo_offset)) {
            $logo_offset = max(20, round((100 - $logo_height) / 2));
        }
        $add = max(0, round(($logo_offset * 2 + $logo_height - 100) / 2));
        addThemeCustomStyle("\n\t\t\theader.noFixMenu .topWrap .logo {\n\t\t\t\theight: " . $logo_height . "px;\n\t\t\t}\n\t\t\theader.noFixMenu .topWrap .logo img {\n\t\t\t\theight: " . $logo_height . "px;\n\t\t\t}\n\t\t\theader.noFixMenu .topWrap .logo .logo_text {\n\t\t\t\tline-height: " . $logo_height . "px;\n\t\t\t}\n\t\t\theader.noFixMenu.menu_right .topWrap .openRightMenu,\n\t\t\theader.noFixMenu.menu_right .topWrap .search {\n\t\t\t\tmargin-top: " . (33 + $add) . "px;\n\t\t\t\tmargin-bottom: " . (37 + $add) . "px;\n\t\t\t}\n\t\t\theader.noFixMenu.menu_right .topWrap .topMenuStyleLine > ul > li {\n\t\t\t\tpadding-top: " . (30 + $add) . "px;\n\t\t\t\tpadding-bottom: " . (30 + $add) . "px;\n\t\t\t}\n\t\t\theader.noFixMenu.menu_right .topWrap .topMenuStyleLine > ul#mainmenu > li > .menu-panel,\n\t\t\theader.noFixMenu.menu_right .topWrap .topMenuStyleLine > ul > li > ul {\n\t\t\t\ttop: " . (100 + $add) . "px;\n\t\t\t}\n\t\t");
    }
    // Logo top offset
    if ($logo_offset > 0) {
        addThemeCustomStyle("\n\t\t\theader.noFixMenu .topWrap .logo {\n\t\t\t\tpadding: " . $logo_offset . "px 0 0 0;\n\t\t\t}\n\t\t");
    }
    $logo_height = (int) get_theme_option('logo_image_footer_height');
    if ($logo_height > 10) {
        addThemeCustomStyle("\n\t\t\tfooter .logo img {\n\t\t\t\theight: " . $logo_height . "px;\n\t\t\t}\n\t\t");
    }
    // Main Slider height
    $slider_height = (int) get_custom_option('slider_height');
    if ($slider_height > 10) {
        addThemeCustomStyle("\n\t\t\t.sliderHomeBullets {\n\t\t\t\theight: " . $slider_height . "px;\n\t\t\t}\n\t\t");
    }
    // Bg custom image
    global $bg_custom_image_style;
    if ($bg_custom_image_style != '' && get_custom_option('bg_custom_image_style') != '') {
        addThemeCustomStyle("\n\t\t\t.sc_quote_style_1,\n\t\t\t.audio_container,\n\t\t\t.topTabsWrap,\n\t\t\t.relatedPostWrap article .wrap.no_thumb,\n\t\t\t.postAside,\n\t\t\t.postStatus,\n\t\t\t.postLink,\n\t\t\t.portfolioWrap .isotopePadding,\n\t\t\t.userFooterSection.global,\n\t\t\t.sc_testimonials_style {\n\t\t\t\tbackground-image:url(" . $bg_custom_image_style . ");\n\t\t\t}\n\t\t\t.sc_testimonials_style {\n\t\t\t\tbackground-size: 100% auto;\n\t\t\t}\n\t\t");
    }
    // Bg custom image in header
    global $bg_custom_image_style_header;
    if ($bg_custom_image_style_header != '') {
        addThemeCustomStyle("\n\t\t\t.userHeaderSection.global {\n\t\t\t\tbackground-image:url(" . $bg_custom_image_style_header . ");\n\t\t\t}\n\t\t");
    } else {
        if ($bg_custom_image_style != '' && get_custom_option('bg_custom_image_style') != '') {
            addThemeCustomStyle("\n\t\t\t.userHeaderSection.global {\n\t\t\t\tbackground-image:url(" . $bg_custom_image_style . ");\n\t\t\t}\n\t\t");
        }
    }
    // Custom css from theme options
    $css = get_custom_option('custom_css');
    if (!empty($css)) {
        addThemeCustomStyle($css);
    }
    $custom_style = '';
    $customizer = get_theme_option('show_theme_customizer') == 'yes';
    // Theme color from customizer
    $clr = '';
    if ($customizer) {
        $clr = getValueGPC('theme_color', '');
    }
    if (empty($clr)) {
        $clr = get_custom_option('theme_color');
    }
    if (!empty($clr)) {
        $rgb = hex2rgb($clr);
        $custom_style .= '
a:hover,
.theme_accent,
.theme_accent:before,
.topTabsWrap .speedBar a:hover,
.topWrap .topMenuStyleLine > ul > li ul li a:hover,
.topWrap .topMenuStyleLine .current-menu-item > a,
.topWrap .topMenuStyleLine .current-menu-ancestor > a,
.topWrap .topMenuStyleLine > ul li a:hover,
.topWrap .topMenuStyleLine > ul li.sfHover > a,
.infoPost a:hover,
//.........这里部分代码省略.........
开发者ID:WestBayResidential,项目名称:wbrsorg,代码行数:101,代码来源:theme-customizer.php


示例20: widget

    /**
     * How to display the widget on the screen.
     */
    function widget($args, $instance)
    {
        extract($args);
        global $wp_query, $post;
        /* Our variables from the widget settings. */
        $title = apply_filters('widget_title', isset($instance['title']) ? $instance['title'] : '');
        $title_tabs = array(apply_filters('widget_title', isset($instance['title_author']) ? $instance['title_author'] : ''), apply_filters('widget_title', isset($instance['title_users']) ? $instance['title_users'] : ''));
        $number = isset($instance['number']) ? (int) $instance['number'] : '';
        $show_date = isset($instance['show_date']) ? (int) $instance['show_date'] : 0;
        $show_image = isset($instance['show_image']) ? (int) $instance['show_image'] : 0;
        $show_author = isset($instance['show_author']) ? (int) $instance['show_author'] : 0;
        $show_counters = isset($instance['show_counters']) ? (int) $instance['show_counters'] : 0;
        $category = isset($instance['category']) ? (int) $instance['category'] : 0;
        $counters = 'stars';
        $output = '';
        $tabs = array();
        $reviews_first_author = get_theme_option('reviews_first') == 'author';
        $reviews_second_hide = get_theme_option('reviews_second') == 'hide';
        for ($i = 0; $i < 2; $i++) {
            if ($i == 0 && !$reviews_first_author && $reviews_second_hide) {
                continue;
            }
            if ($i == 1 && $reviews_first_author && $reviews_second_hide) {
                continue;
            }
            $args = array('post_type' => 'post', 'post_status' => current_user_can('read_private_pages') && current_user_can('read_private_posts') ? array('publish', 'private') : 'publish', 'post_password' => '', 'posts_per_page' => $number, 'ignore_sticky_posts' => 1, 'order' => 'DESC', 'orderby' => 'meta_value_num', 'meta_key' => 'reviews_avg' . ($i == 0 ? '' : '2'));
            if ($category > 0) {
                $args['cat'] = $category;
            }
            $ex = get_theme_option('exclude_cats');
            if (!empty($ex)) {
                $args['category__not_in'] = explode(',', $ex);
            }
            query_posts($args);
            /* Loop posts */
            if (have_posts()) {
                $tabs[$i] = '<li><a href="#widget_top10_' . $i . '" class="theme_button"><span>' . $title_tabs[$i] . '</span></a></li>';
                $output .= '
					<div class="tab_content" id="widget_top10_' . $i . '"' . ($i == 1 && !$output ? ' style="display: block;"' : '') . '>
				';
                $post_number = 0;
                while (have_posts()) {
                    the_post();
                    $post_number++;
                    $post_id = get_the_ID();
                    $post_date = getDateOrDifference(get_the_date('Y-m-d H:i:s'));
                    $post_title = $post->post_title;
                    $post_link = get_permalink();
                    $output .= '
						<div class="post_item' . ($post_number == 1 ? ' first' : '') . '">
					';
                    if ($show_image) {
                        $post_thumb = getResizedImageTag($post_id, 60, 60);
                        if ($post_thumb) {
                            $output .= '
									<div class="post_thumb image_wrapper">' . $post_thumb . '</div>
							';
                        }
                    }
                    $output .= '
									<div class="post_wrapper">
										<h5 class="post_title theme_title' . ($show_counters == 2 ? '' : ' title_padding') . '"><a href="' . $post_link . '">' . $post_title . '</a></h5>
					';
                    if ($show_counters) {
                        $post_counters = marksToDisplay(get_post_meta($post_id, 'reviews_avg' . ($i == 0 ? '' : '2'), true));
                        if ($post_counters > 0) {
                            if (themerex_strlen($post_counters) == 1) {
                                $post_counters .= '.0';
                            }
                            if ($show_counters == 2 && get_custom_option('show_reviews') == 'yes') {
                                $output .= '
									<div class="reviews_summary blog_reviews">
										<div class="criteria_summary criteria_row">
											' . getReviewsSummaryStars($post_counters) . '
										</div>
									</div>
								';
                            }
                        }
                    }
                    if ($show_date || $show_counters || $show_author) {
                        $output .= '
										<div class="post_info theme_info">
						';
                        if ($show_date) {
                            $output .= '
												<span class="post_date theme_text">' . $post_date . '</span>
							';
                        }
                        if ($show_author) {
                            $post_author_id = $post->post_author;
                            $post_author_name = get_the_author_meta('display_name', $post_author_id);
                            $post_author_url = get_author_posts_url($post_author_id, '');
                            $output .= '
											<span class="post_author">' . __('by', 'themerex') . ' <a href="' . $post_author_url . '">' . $post_author_name . '</a></span>
							';
                        }
//.........这里部分代码省略.........
开发者ID:nickandersonr,项目名称:FriedMagazine,代码行数:101,代码来源:widget-top10.php



注:本文中的get_custom_option函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_customer函数代码示例发布时间:2022-05-15
下一篇:
PHP get_custom_logo函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap