本文整理汇总了PHP中get_custom_option函数的典型用法代码示例。如果您正苦于以下问题:PHP get_custom_option函数的具体用法?PHP get_custom_option怎么用?PHP get_custom_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_custom_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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 '';
}
}
}
示例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);
}
示例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();
示例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
}
}
}
示例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 {
示例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';
}
}
示例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) {
示例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
示例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
}
}
示例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
}
示例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' : '');
?>
">