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

PHP ts_get_featured_media函数代码示例

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

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



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

示例1: ts_get_blog_loop_title_size

$show_excerpt = $excerpt_length == '0' || !$ts_show->excerpt ? false : true;
$title_size = ts_get_blog_loop_title_size($atts, 2);
$text_align = ts_get_blog_loop_text_align($atts);
$allow_vids = isset($atts['allow_videos']) ? $atts['allow_videos'] : 'yes';
$allow_gals = isset($atts['allow_galleries']) ? $atts['allow_galleries'] : 'yes';
if ($ts_query->have_posts()) {
    $i = 1;
    while ($ts_query->have_posts()) {
        $ts_query->the_post();
        $atts['exclude_these_later'] = isset($atts['exclude_these_later']) ? $atts['exclude_these_later'] : '';
        if (!ts_attr_is_false($atts['exclude_these_later'])) {
            $ts_previous_posts[] = $ts_query->post->ID;
        }
        $post_type = get_post_type();
        $category = ts_get_the_category('category', 'big_array:1', '', $ts_query->post->ID);
        $media = ts_get_featured_media(array('allow_videos' => $allow_vids, 'allow_galleries' => $allow_gals));
        ?>
                        
                        <div id="post-<?php 
        echo esc_attr($ts_query->post->ID);
        ?>
" class="hentry entry">
                            <div class="post-content">
                                <div class="post-category post-category-heading mimic-small uppercase">
                                    <a href="<?php 
        echo get_category_link($category[0]['term_id']);
        ?>
"><strong><?php 
        echo esc_html($category[0]['name']);
        ?>
</strong></a>
开发者ID:estvmachine,项目名称:nicowp,代码行数:31,代码来源:loop.php


示例2: ts_maybe_show_blog_elements

$ts_show = ts_maybe_show_blog_elements($atts);
$show_excerpt = $excerpt_length == '0' || !$ts_show->excerpt ? false : true;
$title_size = ts_get_blog_loop_title_size($atts, 4);
$text_align = ts_get_blog_loop_text_align($atts);
$allow_vids = isset($atts['allow_videos']) ? $atts['allow_videos'] : '';
$allow_gals = isset($atts['allow_galleries']) ? $atts['allow_galleries'] : '';
if ($ts_query->have_posts()) {
    while ($ts_query->have_posts()) {
        $ts_query->the_post();
        $atts['exclude_these_later'] = isset($atts['exclude_these_later']) ? $atts['exclude_these_later'] : '';
        if (!ts_attr_is_false($atts['exclude_these_later'])) {
            $ts_previous_posts[] = $ts_query->post->ID;
        }
        $post_type = get_post_type();
        $category = ts_get_the_category(ts_get_the_display_taxonomy($atts), 'big_array:1', '', $ts_query->post->ID);
        $media = ts_get_featured_media(array('media_width' => 480, 'media_height' => 0, 'gallery_width' => 480, 'gallery_height' => 320, 'allow_videos' => $allow_vids, 'allow_galleries' => $allow_gals));
        ?>

                        <div id="post-<?php 
        echo esc_attr($ts_query->post->ID);
        ?>
" class="hentry entry masonry-entry <?php 
        echo esc_attr($entry_class);
        ?>
">
                            <div class="post-content">
                                <div class="post-category post-category-heading mimic-small uppercase <?php 
        echo ts_loop_post_category_class($atts, $media);
        ?>
">
                                    <a href="<?php 
开发者ID:dqishmirian,项目名称:jrrny,代码行数:31,代码来源:loop-masonry.php


示例3: while

if ($ts_query->have_posts()) {
    $i = 1;
    while ($ts_query->have_posts()) {
        $ts_query->the_post();
        ?>
                        
                        <div id="post-<?php 
        echo esc_attr($ts_query->post->ID);
        ?>
" class="hentry entry ts-boxed-one-half <?php 
        echo esc_attr(ts_get_the_category('portfolio-category', 'filter-slugs', ' '));
        ?>
">
                            <div class="post-content">
                                <?php 
        echo ts_get_featured_media(array('media_width' => 510, 'media_height' => 340, 'allow_videos' => 'no'));
        ?>
  
                                <div class="title-info">                               
                                    <div class="full-link"><a href="<?php 
        the_permalink();
        ?>
"></a></div>
                                    <div class="title-info-inner">
                                        <h3 class="title text-center entry-title"><?php 
        the_title();
        ?>
</h3>
                                        <p class="text-center mimic-smaller"><?php 
        echo ts_get_the_category('portfolio-category');
        ?>
开发者ID:estvmachine,项目名称:nicowp,代码行数:31,代码来源:loop-2-column.php


示例4: while

if ($ts_query->have_posts()) {
    while ($ts_query->have_posts()) {
        $ts_query->the_post();
        ?>
                        
                        <div id="post-<?php 
        echo esc_attr($ts_query->post->ID);
        ?>
" class="hentry entry masonry-entry <?php 
        echo esc_attr($entry_class . ' ' . ts_get_the_category('portfolio-category', 'filter-slugs', ' '));
        ?>
">
                            <div class="post-content">
                                <?php 
        $featured_media_args = array('media_width' => 480, 'media_height' => 0, 'gallery_width' => 480, 'gallery_height' => 320, 'allow_videos' => 'no');
        echo ts_get_featured_media($featured_media_args);
        ?>
 
                                <div class="post-content-inner">
                                    <div class="title-date">
                                        <div class="title-info">                                    
                                            <h4 class="<?php 
        echo esc_attr($atts['title_align']);
        ?>
"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h4>
开发者ID:sekane81,项目名称:ratoninquietoweb,代码行数:31,代码来源:loop-masonry-cards.php


示例5: while

">                     
            <?php 
if (have_posts()) {
    while (have_posts()) {
        the_post();
        ?>
                <div id="main-container" class="container clearfix">
                    <div id="main" class="<?php 
        echo esc_attr(ts_main_div_class());
        ?>
 clearfix">
                        <div class="entry single-entry clearfix">
                            <?php 
        if (ts_option_vs_default('show_images_on_post', 1) == 1) {
            $featured_media_vars = array('media_width' => $crop_width, 'media_height' => $crop_height, 'allow_audio' => 1, 'allow_self_hosted_video' => 1, 'is_single' => 1);
            $featured_media = ts_get_featured_media($featured_media_vars);
            echo trim($featured_media) ? '<div id="ts-post-featured-media-wrap">' . ts_escape($featured_media) . '</div>' : '';
        }
        ?>
                            
                            <div id="ts-post-content-sidebar-wrap" class="clearfix">
                                <div id="ts-post-wrap">
                                    
                                    <div id="ts-post" <?php 
        post_class('post ts-post-section clearfix');
        ?>
>
                                        
                                        
                                        <div id="ts-post-the-content-wrap">
                                            
开发者ID:estvmachine,项目名称:nicowp,代码行数:30,代码来源:single.php


示例6: ts_get_blog_loop_title_size

$title_size = ts_get_blog_loop_title_size($atts, 4);
$text_align = ts_get_blog_loop_text_align($atts);
$allow_vids = isset($atts['allow_videos']) ? $atts['allow_videos'] : '';
$allow_gals = isset($atts['allow_galleries']) ? $atts['allow_galleries'] : '';
$mw = 510;
$mh = ts_loop_media_height('list', $atts, $mw);
if ($ts_query->have_posts()) {
    while ($ts_query->have_posts()) {
        $ts_query->the_post();
        $atts['exclude_these_later'] = isset($atts['exclude_these_later']) ? $atts['exclude_these_later'] : '';
        if (!ts_attr_is_false($atts['exclude_these_later'])) {
            $ts_previous_posts[] = $ts_query->post->ID;
        }
        $post_type = get_post_type();
        $category = ts_get_the_category(ts_get_the_display_taxonomy($atts), 'big_array:1', '', $ts_query->post->ID);
        $media = ts_get_featured_media(array('media_width' => $mw, 'media_height' => $mh, 'allow_videos' => $allow_vids, 'allow_galleries' => $allow_gals));
        ?>
                        
                        <div id="post-<?php 
        the_ID();
        ?>
" class="hentry entry clearfix">
                            <div class="post-content clearfix">
                                <div class="post-category post-category-heading mimic-small uppercase <?php 
        echo ts_loop_post_category_class($atts, $media);
        ?>
">
                                    <a href="<?php 
        echo ts_get_term_link($category[0]);
        ?>
"><strong><?php 
开发者ID:dqishmirian,项目名称:jrrny,代码行数:31,代码来源:loop-medium-image.php


示例7: ts_maybe_show_blog_elements

$ts_show = ts_maybe_show_blog_elements($atts);
$show_excerpt = $excerpt_length == '0' || !$ts_show->excerpt ? false : true;
$title_size = ts_get_blog_loop_title_size($atts, 2);
$text_align = ts_get_blog_loop_text_align($atts);
if ($ts_query->have_posts()) {
    $i = 1;
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
    $limit = isset($atts['limit']) ? $atts['limit'] : get_option('posts_per_page');
    while ($ts_query->have_posts()) {
        $ts_query->the_post();
        $atts['exclude_these_later'] = isset($atts['exclude_these_later']) ? $atts['exclude_these_later'] : '';
        if (!ts_attr_is_false($atts['exclude_these_later'])) {
            $ts_previous_posts[] = $ts_query->post->ID;
        }
        $post_type = get_post_type();
        $media = ts_get_featured_media(array('allow_videos' => 'no', 'allow_galleries' => 'no', 'media_width' => $imagew, 'media_height' => $imageh));
        $media_class = trim($media) ? 'has-media' : 'has-no-media';
        $category = ts_get_the_category(ts_get_the_display_taxonomy($atts), 'big_array:1', '', $ts_query->post->ID);
        ?>
                        
                        <div id="post-<?php 
        the_ID();
        ?>
" class="hentry entry clearfix <?php 
        echo esc_attr($odd_even . ' ' . $media_class);
        ?>
">
                            <div class="post-content">
                                <?php 
        if ($ts_show->media) {
            echo balanceTags($media);
开发者ID:dqishmirian,项目名称:jrrny,代码行数:31,代码来源:loop-banner.php


示例8: isset

        $atts['exclude_these_later'] = isset($atts['exclude_these_later']) ? $atts['exclude_these_later'] : '';
        if (!ts_attr_is_false($atts['exclude_these_later'])) {
            $ts_previous_posts[] = $ts_query->post->ID;
        }
        $descr = has_excerpt() ? strip_tags(get_the_excerpt()) : apply_filters('the_content', get_the_content());
        $descr = ts_trim_text($descr, $excerpt_length);
        $show_excerpt = count(trim($descr)) < 1 ? false : $show_excerpt;
        $url = get_permalink();
        $date = get_the_date('M j, Y');
        $category = ts_get_the_category('category', 'big_array:1', '', $ts_query->post->ID);
        $cat_name = $category[0]['name'];
        $cat_color = $category[0]['color'] ? $category[0]['color'] : 'primary';
        $alt_cat_name = get_post_meta($ts_query->post->ID, '_p_alt_category_text', true);
        $cat_name = trim($alt_cat_name) ? $alt_cat_name : $cat_name;
        $allow_vids = isset($atts['allow_videos']) ? $atts['allow_videos'] : '';
        $media = ts_get_featured_media(array('allow_videos' => $allow_vids, 'allow_video_embed_code' => 'no', 'allow_galleries' => 'no', 'within_slider' => true, 'slider_type' => $slider_type, 'media_width' => $img_width, 'media_height' => $img_height, 'return' => 'big_array'));
        $media = ts_array2object($media);
        ?>
                        
                        <<?php 
        echo tag_escape($item_el);
        ?>
 class="<?php 
        echo esc_attr($item_class);
        ?>
 ts-slider-item" data-width="<?php 
        echo absint($img_width);
        ?>
" data-height="<?php 
        echo absint($img_height);
        ?>
开发者ID:estvmachine,项目名称:nicowp,代码行数:31,代码来源:loop-slider.php


示例9: ts_maybe_show_blog_elements

$ts_show = ts_maybe_show_blog_elements($atts);
$show_excerpt = $excerpt_length == '0' || !$ts_show->excerpt ? false : true;
$title_size = ts_get_blog_loop_title_size($atts, 4);
$text_align = ts_get_blog_loop_text_align($atts);
$allow_gals = isset($atts['allow_galleries']) ? $atts['allow_galleries'] : '';
if ($ts_query->have_posts()) {
    $i = 1;
    while ($ts_query->have_posts()) {
        $ts_query->the_post();
        $atts['exclude_these_later'] = isset($atts['exclude_these_later']) ? $atts['exclude_these_later'] : '';
        if (!ts_attr_is_false($atts['exclude_these_later'])) {
            $ts_previous_posts[] = $ts_query->post->ID;
        }
        $post_type = get_post_type();
        $category = ts_get_the_category('category', 'big_array:1', '', $ts_query->post->ID);
        $media = ts_get_featured_media(array('media_width' => 510, 'media_height' => 340, 'allow_videos' => 'no', 'allow_galleries' => $allow_gals));
        ?>
                        
                        <div id="post-<?php 
        echo esc_attr($ts_query->post->ID);
        ?>
" class="hentry entry span6">
                            <div class="post-content">
                                <div class="post-category post-category-heading mimic-small uppercase">
                                    <a href="<?php 
        echo get_category_link($category[0]['term_id']);
        ?>
"><strong><?php 
        echo esc_html($category[0]['name']);
        ?>
</strong></a>
开发者ID:estvmachine,项目名称:nicowp,代码行数:31,代码来源:loop-2-column.php


示例10: ts_get_blog_loop_title_size

$show_excerpt = $excerpt_length == '0' || !$ts_show->excerpt ? false : true;
$title_size = ts_get_blog_loop_title_size($atts, 4);
$text_align = ts_get_blog_loop_text_align($atts);
$allow_vids = isset($atts['allow_videos']) ? $atts['allow_videos'] : '';
$allow_gals = isset($atts['allow_galleries']) ? $atts['allow_galleries'] : '';
if ($ts_query->have_posts()) {
    $i = 1;
    while ($ts_query->have_posts()) {
        $ts_query->the_post();
        $atts['exclude_these_later'] = isset($atts['exclude_these_later']) ? $atts['exclude_these_later'] : '';
        if (!ts_attr_is_false($atts['exclude_these_later'])) {
            $ts_previous_posts[] = $ts_query->post->ID;
        }
        $post_type = get_post_type();
        $meta_hidden = $ts_show->meta ? '' : 'hidden';
        $media = ts_get_featured_media(array('media_width' => 400, 'media_height' => 267, 'allow_videos' => $allow_vids, 'allow_galleries' => $allow_gals, 'wrap_class' => $media_class));
        ?>
                        <div id="post-<?php 
        the_ID();
        ?>
" class="hentry entry clearfix container">
                            <div class="post-content <?php 
        echo esc_attr($row_class);
        ?>
">
                                <?php 
        if ($ts_show->media || $ts_show->meta) {
            ?>
                                <div class="ts-meta-wrap <?php 
            echo $ts_show->media && trim($media) && !($ts_show->featured_first && $i > 1) ? 'media-meta-wrap' : 'meta-wrap';
            ?>
开发者ID:dqishmirian,项目名称:jrrny,代码行数:31,代码来源:loop-widget.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP ts_get_the_category函数代码示例发布时间:2022-05-23
下一篇:
PHP ts_get_animation_data_class函数代码示例发布时间: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