コード例 #1
0
ファイル: loop-slider.php プロジェクト: estvmachine/nicowp
        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);
        ?>
">
コード例 #2
0
function ts_sharing_options_on_posts($postid = null)
{
    global $post, $ts_page_id;
    $postid = $postid ? $postid : (isset($post->ID) ? $post->ID : $ts_page_id);
    $return = array();
    $ts_sharing_options_position_option = ts_option_vs_default('sharing_options_position_on_post', 'top');
    $ts_sharing_options_position = ts_postmeta_vs_default($postid, '_p_sharing_options_position', $ts_sharing_options_position_option);
    $return['position'] = in_array($ts_sharing_options_position, array('left', 'right', 'hidden', 'top')) ? $ts_sharing_options_position : 'top';
    $return['position_class'] = $return['position'] == 'top' ? 'not-pulled' : 'pulled pull-' . $return['position'];
    $return['show'] = $ts_sharing_options_position == 'hidden' ? false : true;
    return ts_array2object($return);
}