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

PHP ts_postmeta_vs_default函数代码示例

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

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



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

示例1: esc_url

                    echo ' <span class="sep sep-1">&nbsp;/&nbsp;</span> ';
                    echo '<a href="' . esc_url(get_permalink()) . '#reviews" class="to-comments-link reviews-smoothscroll">' . $comment_number . ' ';
                    echo $comment_number == 1 ? __('Review', 'ThemeStockyard') : __('Reviews', 'ThemeStockyard');
                    echo '</a>' . "\n";
                }
            } else {
                echo ' <span class="sep sep-2">&nbsp;/&nbsp;</span> ';
                echo '<span class="mimic-small">';
                echo __('By', 'ThemeStockyard') . ' ';
                echo '<span class="author vcard">';
                echo '<a href="' . get_author_posts_url($post->post_author) . '">' . get_the_author_meta('display_name', $post->post_author) . '</a>';
                echo '</span>';
                echo '</span>';
                if (ts_option_vs_default('show_titlebar_post_view_count', 0) == 1) {
                    $ts_postview_nonce = wp_create_nonce('ts_update_postviews_nonce');
                    $post_view_count = ts_postmeta_vs_default($ts_page_id, '_p_ts_postviews', 0);
                    $post_view_count = !$post_view_count ? '0' : $post_view_count;
                    $post_view_count_text = sprintf(_n('1 view', '%s views', $post_view_count, 'ThemeStockyard'), $post_view_count);
                    echo ' <span class="sep sep-3">&nbsp;/&nbsp;</span> ';
                    echo '<span id="ts-postviews" data-pid="' . esc_attr($ts_page_id) . '" data-nonce="' . esc_attr($ts_postview_nonce) . '">';
                    echo '<i class="fa fa-eye"></i>' . esc_html($post_view_count_text);
                    echo '</span>';
                }
            }
        } else {
            echo '<!-- comments closed -->' . "\n";
        }
        ?>
</div>
                                <?php 
    } else {
开发者ID:sekane81,项目名称:ratoninquietoweb,代码行数:31,代码来源:title-page.php


示例2: ts_post_direction_nav

            ?>
                                            </div>
                                        </div>
                                        <?php 
        }
        ?>
                                    
                                        <?php 
        if ($ts_direction_links == 'yes') {
            ts_post_direction_nav();
        }
        ?>
                                    
                                        <?php 
        $show_related_option = ts_option_vs_default('show_related_blog_posts', 1) == 1 ? 'yes' : 'no';
        $show_related = ts_postmeta_vs_default($post->ID, '_p_related_posts', $show_related_option);
        if ($show_related == '1' || $show_related == 'yes') {
            ?>
                                        <div class="ts-related-posts-on-single ts-post-section-inner">
                                            <h5 class="smaller uppercase"><?php 
            echo ts_option_vs_default('related_blog_posts_title_text', 'Related Posts');
            ?>
</h4>
                                            <?php 
            $args = array('include' => 'related', 'limit' => 3, 'show_pagination' => 'no', 'media_width' => 480, 'media_height' => 360, 'title_size' => 4, 'allow_videos' => 0, 'allow_galleries' => 0);
            echo ts_blog('3columns', $args);
            ?>
                                        </div>
                                        <?php 
        }
        ?>
开发者ID:estvmachine,项目名称:nicowp,代码行数:31,代码来源:single.php


示例3: get_post_meta

<?php

global $ts_page_id;
$ts_slider_source = get_post_meta($ts_page_id, '_page_slider_source', true);
$ts_slider_type = get_post_meta($ts_page_id, '_page_slider_type', true);
$ts_rev_slider = get_post_meta($ts_page_id, '_page_rev_slider', true);
$ts_slider_first_page = ts_postmeta_vs_default($ts_page_id, '_page_slider_first_page', 'no');
// if "first page only" is turned on,
// don't include the slider.
if ($ts_slider_first_page == 'yes' && get_query_var('paged', 1) > 1) {
    return;
}
// otherwise, carry on...
if (in_array($ts_slider_type, array('carousel', 'flex')) && $ts_slider_source) {
    get_template_part('includes/_sliders/carousel-flex-slider');
}
if ($ts_slider_type == 'rev' && $ts_rev_slider) {
    get_template_part('includes/_sliders/rev-slider');
}
?>

                            
                            <!-- ticker: slider -->
                            <?php 
//echo ts_get_ticker('slider');
?>
                            <!-- /ticker: slider -->
开发者ID:dqishmirian,项目名称:jrrny,代码行数:27,代码来源:slider.php


示例4: get_queried_object

<?php

/*
Template Name: Home - Alternative 4
*/
$ts_page_object = get_queried_object();
$ts_page_id = is_single() ? $post->ID : get_queried_object_id();
$ts_home_alt_4_cat_left = ts_postmeta_vs_default($ts_page_id, '_page_home_alt_4_cat_left', '');
$ts_home_alt_4_cat_right = ts_postmeta_vs_default($ts_page_id, '_page_home_alt_4_cat_right', '');
global $ts_template_content;
$ts_template_content = '[columns_row margin_top="0px" margin_bottom="0px"]
[column size="one_fifth" last="no"]
[blog_widget widget_heading="" widget_layout="vertical" limit="3" cat="' . esc_attr($ts_home_alt_4_cat_left) . '" override_widget_heading="yes" include="" exclude="" exclude_previous_posts="yes" exclude_these_later="yes" excerpt_length="" title_size="" text_align="" show_excerpt="yes" show_meta="yes" show_media="yes" allow_videos="no" allow_galleries="no" ignore_sticky_posts="0"][/blog_widget]
[/column]
[column size="three_fifth" last="no"]
[blog layout="" limit="2" infinite_scroll="no" category_name="" include="" exclude="" exclude_previous_posts="yes" exclude_these_later="yes" excerpt_length="" title_size="" text_align="" show_pagination="no" show_excerpt="yes" show_meta="yes" show_read_more="no" allow_videos="no" allow_galleries="no" ignore_sticky_posts="0"][/blog]
[/column]
[column size="one_fifth" last="yes"]
[blog_widget widget_heading="" widget_layout="vertical" limit="3" cat="' . esc_attr($ts_home_alt_4_cat_right) . '" override_widget_heading="yes" include="" exclude="" exclude_previous_posts="yes" exclude_these_later="yes" excerpt_length="" title_size="" text_align="" show_excerpt="yes" show_meta="yes" show_media="yes" allow_videos="no" allow_galleries="no" ignore_sticky_posts="0"][/blog_widget]
[/column]
[/columns_row]

[blog layout="4-column-grid" limit="4" infinite_scroll="no" category_name="" include="" exclude="" exclude_previous_posts="yes" exclude_these_later="yes" excerpt_length="" title_size="" text_align="" show_pagination="no" show_excerpt="yes" show_meta="yes" show_read_more="no" allow_videos="no" allow_galleries="yes" ignore_sticky_posts="0"][/blog]';
get_template_part('page');
开发者ID:dqishmirian,项目名称:jrrny,代码行数:24,代码来源:home-alt-4.php


示例5: get_queried_object

<?php

/*
Template Name: Sitemap
*/
global $smof_data, $ts_previous_posts, $ts_page_id, $ts_show_top_ticker;
$ts_page_object = get_queried_object();
$ts_page_id = is_single() ? $post->ID : get_queried_object_id();
$ts_custom_css = get_post_meta($ts_page_id, '_page_css', true);
$ts_show_top_ticker_option = ts_option_vs_default('show_page_top_ticker', 0) == 1 ? 'yes' : 'no';
$ts_show_top_ticker = ts_postmeta_vs_default($ts_page_id, '_page_top_ticker', $ts_show_top_ticker_option);
$ts_show_sidebar_option = ts_option_vs_default('show_page_sidebar', 1) != 1 ? 'no' : 'yes';
$ts_show_sidebar = ts_postmeta_vs_default($ts_page_id, '_page_sidebar', $ts_show_sidebar_option);
$ts_sidebar_position_option = ts_option_vs_default('page_sidebar_position', 'right');
$ts_sidebar_position = ts_postmeta_vs_default($ts_page_id, '_page_sidebar_position', $ts_sidebar_position_option);
$ts_page_comments = ts_option_vs_default('page_comments', 0) == 1 ? true : false;
get_header();
get_template_part('top');
get_template_part('title-page');
?>
            <div id="main-container-wrap" class="<?php 
echo esc_attr(ts_main_container_wrap_class('page'));
?>
">
            
                <?php 
get_template_part('slider');
?>
                
                <div id="main-container" class="container clearfix">
                    <div id="main" class="<?php 
开发者ID:estvmachine,项目名称:nicowp,代码行数:31,代码来源:sitemap.php


示例6: get_queried_object

<?php

global $smof_data, $ts_page_id;
$ts_page_object = get_queried_object();
$ts_page_id = is_single() ? $post->ID : get_queried_object_id();
$ts_show_top_ticker_option = ts_option_vs_default('show_page_top_ticker', 0) == 1 ? 'yes' : 'no';
$ts_show_top_ticker = ts_postmeta_vs_default($ts_page_id, '_page_top_ticker', $ts_show_top_ticker_option);
$crop_width = ts_option_vs_default('cropped_featured_image_width_full', 1040, true);
$crop_height = 0;
get_header();
get_template_part('top');
get_template_part('title-page');
?>
            <div id="main-container-wrap" class="<?php 
echo esc_attr(ts_main_container_wrap_class('page'));
?>
">
                <?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
                <div id="main-container" class="container clearfix">
                    <div id="main" class="no-sidebar clearfix">
                        <div class="entry single-entry clearfix">                     
                            <div id="ts-post-content-sidebar-wrap" class="clearfix">
                                <div id="ts-post-wrap">
                                    <div id="ts-post-featured-media-wrap">
                                        <div class="featured-photo text-center"><a href="<?php 
        echo esc_url(get_permalink());
        ?>
开发者ID:dqishmirian,项目名称:jrrny,代码行数:31,代码来源:attachment.php


示例7: ts_postmeta_vs_default

global $smof_data, $ts_slider_post_ids, $ts_page_id, $ts_previous_posts;
$slider_margin_class = ts_postmeta_vs_default($ts_page_id, '_page_slider_bottom_margin', 'yes') == 'no' ? 'has-no-bottom-margin' : 'has-bottom-margin';
$slider_width = ts_postmeta_vs_default($ts_page_id, '_page_slider_width', 'content');
$slider_width_class = $slider_width == 'content' ? 'container' : 'full';
$slider_height_default = 500;
$slider_height = preg_replace("/[^0-9]*/", "", ts_postmeta_vs_default($ts_page_id, '_page_slider_height', $slider_height_default));
$slider_height = ctype_digit($slider_height) && $slider_height > 100 ? $slider_height : $slider_height_default;
$slider_height = $slider_height == 'screen' && $slider_width_class == 'full' ? 'screen' : $slider_height;
if ($slider_height != 'screen') {
    $slider_height = ts_number_within_range($slider_height, 300, 800) ? $slider_height : $slider_height_default;
}
$slider_height_class = $slider_height == 'screen' ? 'slider-screen-height' : '';
$slider_carousel_height = preg_replace("/[^0-9]*/", "", ts_postmeta_vs_default($ts_page_id, '_page_slider_carousel_height', '420'));
$slider_text_align = ts_postmeta_vs_default($ts_page_id, '_page_slider_text_align', 'left');
$slider_text_align = in_array($slider_text_align, array('left', 'center', 'right')) ? $slider_text_align : 'left';
$slider_allow_vids = ts_postmeta_vs_default($ts_page_id, '_page_slider_allow_videos', 'no');
$slider_allow_vids = $slider_allow_vids == 'yes' ? true : false;
$ts_slider_type = get_post_meta($ts_page_id, '_page_slider_type', true);
$ts_slider_parallax = get_post_meta($ts_page_id, '_page_slider_enable_parallax', true);
$ts_slider_source = get_post_meta($ts_page_id, '_page_slider_source', true);
$ts_slider_blog_post_ids = get_post_meta($ts_page_id, '_page_slider_blog_post_ids', true);
$ts_slider_category = get_post_meta($ts_page_id, '_page_slider_category', true);
$ts_slider_blog_cats = get_post_meta($ts_page_id, '_page_slider_blog_cats');
// array
$ts_slider_portfolio_cats = get_post_meta($ts_page_id, '_page_slider_portfolio_cats', true);
$ts_slider_count = get_post_meta($ts_page_id, '_page_slider_count', true);
$ts_slider_count = $ts_slider_count ? $ts_slider_count : 10;
$get_alt_text = ts_option_vs_default('featured_image_alt_text_within_loop', 0) ? true : false;
$slider_button_color = ts_option_vs_default('flexslider_button_color', 'white');
if (in_array($ts_slider_type, array('carousel', 'flex')) && $ts_slider_source) {
    $parallax_class = $slider_width_class == 'full' && $ts_slider_parallax == 'yes' ? 'ts-is-parallax' : '';
开发者ID:sekane81,项目名称:ratoninquietoweb,代码行数:31,代码来源:carousel-flex-slider.php


示例8: ts_postmeta_vs_default

<?php

global $ts_page_id;
if (function_exists('putRevSlider')) {
    $slider_width = ts_postmeta_vs_default($ts_page_id, '_page_slider_width', 'fullwidth');
    $slider_width_class = $slider_width == 'content' ? 'container' : 'full';
    $rev_slider_id = get_post_meta($ts_page_id, '_page_rev_slider', true);
    if (get_post_meta($ts_page_id, '_page_slider_type', true) == 'rev' && $rev_slider_id) {
        echo '<div id="main-slider-wrap" class="ts-slider-wrap ts-rev-slider-wrap clear ' . esc_attr($slider_width_class) . '">' . "\n";
        putRevSlider($rev_slider_id);
        echo '</div>';
    }
}
开发者ID:sekane81,项目名称:ratoninquietoweb,代码行数:13,代码来源:rev-slider.php


示例9: get_queried_object

<?php

/*
Template Name: Home - Alternative 3
*/
$ts_page_object = get_queried_object();
$ts_page_id = is_single() ? $post->ID : get_queried_object_id();
$ts_home_alt_3_cat = ts_postmeta_vs_default($ts_page_id, '_page_home_alt_3_cat', '');
global $ts_template_content;
$ts_template_content = '[columns_row margin_top="0px" margin_bottom="0px"]
[column size="two_third" last="no"]
[blog_slider limit="3" category_name="" include="" exclude="" exclude_previous_posts="yes" exclude_these_later="yes" title_size="" text_align="center" allow_videos="yes" image_size="medium" ignore_sticky_posts="0"][/blog_slider]
[/column]
[column size="one_third" last="yes"]
[blog_widget widget_heading="" widget_layout="vertical" limit="2" cat="' . esc_attr($ts_home_alt_3_cat) . '" override_widget_heading="yes" include="" exclude="" exclude_previous_posts="yes" exclude_these_later="yes" excerpt_length="" title_size="" text_align="" show_excerpt="no" show_meta="yes" show_media="first" allow_videos="yes" allow_galleries="yes" ignore_sticky_posts="0"][/blog_widget]
[/column]
[/columns_row]

[divider height="40"]

[blog_banner columns="2" limit="6" fullwidth="no" infinite_scroll="no" category_name="" include="" exclude="" exclude_previous_posts="yes" exclude_these_later="yes" excerpt_length="" show_pagination="no" ignore_sticky_posts="0"][/blog_banner]

[blog layout="3-column-grid" limit="3" infinite_scroll="no" category_name="" include="" exclude="" exclude_previous_posts="yes" exclude_these_later="yes" excerpt_length="" title_size="" text_align="" show_pagination="no" show_excerpt="yes" show_meta="yes" show_read_more="no" allow_videos="yes" allow_galleries="yes" ignore_sticky_posts="0"][/blog]';
get_template_part('page');
开发者ID:sekane81,项目名称:ratoninquietoweb,代码行数:24,代码来源:home-alt-3.php


示例10: ts_update_postviews

function ts_update_postviews()
{
    if (!wp_verify_nonce($_REQUEST['nonce'], "ts_update_postviews_nonce")) {
        exit('no funny business');
    }
    if (ts_option_vs_default('show_titlebar_post_view_count', 0) == 1) {
        $post = get_post($_POST['pid']);
        if (is_object($post) && isset($post->ID)) {
            $post_view_count = ts_postmeta_vs_default($post->ID, '_p_ts_postviews', 0);
            $post_view_count_text = sprintf(_n('1 view', '%s views', $post_view_count, 'ThemeStockyard'), $post_view_count);
            $post_view_count++;
            update_post_meta($post->ID, '_p_ts_postviews', $post_view_count);
            return $post_view_count_text;
        }
    }
    exit;
}
开发者ID:estvmachine,项目名称:nicowp,代码行数:17,代码来源:theme-functions.php


示例11: ts_option_vs_default

$ts_previous_posts[] = $ts_page_id;
$ts_show_top_ticker_option = ts_option_vs_default('show_post_top_ticker', 0) == 1 ? 'yes' : 'no';
$ts_show_top_ticker = ts_postmeta_vs_default($ts_page_id, '_post_top_ticker', $ts_show_top_ticker_option);
$ts_show_sidebar_option = ts_option_vs_default('show_post_sidebar', 1) != 1 ? 'no' : 'yes';
$ts_show_sidebar = ts_postmeta_vs_default($post->ID, '_p_sidebar', $ts_show_sidebar_option);
$ts_show_sidebar_class = $ts_show_sidebar == 'yes' ? 'has-sidebar' : 'no-sidebar';
$ts_sidebar_position_option = ts_option_vs_default('post_sidebar_position', 'right');
$ts_sidebar_position = ts_postmeta_vs_default($post->ID, '_p_sidebar_position', $ts_sidebar_position_option);
$ts_direction_links_option = ts_option_vs_default('post_show_direction_links', 'yes');
$ts_direction_links = ts_postmeta_vs_default($post->ID, '_p_show_direction_links', $ts_direction_links_option);
$ts_sharing_position_option = ts_option_vs_default('sharing_options_position_on_post', 'top');
$ts_sharing_position = ts_postmeta_vs_default($post->ID, '_p_sharing_options_position', $ts_sharing_position_option);
$ts_show_featured_media_option = ts_option_vs_default('show_images_on_post', 1) == 1 ? 'yes' : 'no';
$ts_show_featured_media = ts_postmeta_vs_default($post->ID, '_p_show_featured_image_on_single', $ts_show_featured_media_option);
$crop_images_option = ts_option_vs_default('crop_images_on_post', 1) ? 'yes' : 'no';
$crop_images = ts_postmeta_vs_default($post->ID, '_p_crop_images', $crop_images_option);
if ($ts_show_sidebar == 'yes' && in_array($ts_sidebar_position, array('left', 'right'))) {
    if (in_array($crop_images, array('1', 'yes', 'true'))) {
        $crop_width = ts_option_vs_default('cropped_featured_image_width', 740, true);
        $crop_height = ts_option_vs_default('cropped_featured_image_height', 480, true);
    } else {
        $crop_width = ts_option_vs_default('cropped_featured_image_width', 740, true);
        $crop_height = 0;
    }
} else {
    if (in_array($crop_images, array('1', 'yes', 'true'))) {
        $crop_width = ts_option_vs_default('cropped_featured_image_width_full', 1100, true);
        $crop_height = ts_option_vs_default('cropped_featured_image_height_full', 540, true);
    } else {
        $crop_width = ts_option_vs_default('cropped_featured_image_width_full', 1100, true);
        $crop_height = 0;
开发者ID:dqishmirian,项目名称:jrrny,代码行数:31,代码来源:edit-single+(copy).php


示例12: ts_postmeta_vs_default

<?php

/*
 * The Sidebar containing the primary and secondary widget areas.
 */
global $smof_data, $ts_page_id, $post, $ts_grab_home_sidebar, $ts_show_sidebar, $ts_sidebar_position, $ts_sidebar_instance;
if (!isset($ts_show_sidebar) || ts_is_woo_shop()) {
    if (is_single()) {
        $ts_show_sidebar = ts_postmeta_vs_default($ts_page_id, '_p_sidebar', 'yes');
    } else {
        $ts_show_sidebar = ts_postmeta_vs_default($ts_page_id, '_page_sidebar', 'yes');
    }
}
if ($ts_show_sidebar == 'yes') {
    $ts_sbs = $ts_sidebar_selection_id = '';
    $ts_sidebar_selection = get_post_meta($ts_page_id, '_sbg_selected_sidebar_replacement', true);
    $ts_sidebar_selection = is_array($ts_sidebar_selection) ? $ts_sidebar_selection[0] : $ts_sidebar_selection;
    if ($ts_sidebar_selection && class_exists('sidebar_generator')) {
        $ts_sidebar_selection_options = sidebar_generator::get_sidebars();
        $ts_sidebar_selection_name = $ts_sbs = str_replace(array("\n", "\r", "\t", ' '), '', $ts_sidebar_selection);
        $ts_sidebar_selection_id = sidebar_generator::name_to_class($ts_sidebar_selection_name);
        if (!isset($ts_sidebar_selection_options[$ts_sidebar_selection_id])) {
            $ts_sidebar_selection = 0;
        }
    }
    ?>

		<div id="sidebar" class="<?php 
    echo esc_attr($ts_sbs);
    ?>
 sidebar <?php 
开发者ID:sekane81,项目名称:ratoninquietoweb,代码行数:31,代码来源:sidebar.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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