当前位置: 首页>>代码示例>>PHP>>正文


PHP cb_thumbnail函数代码示例

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


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

示例1: cb_thumbnail

               </div>
                                 
        </article> 
		
<?php 
        } else {
            ?>

        <article class="cb-article cb-small clearfix" role="article">
    	    
      	 	<div class="cb-mask" style="background-color:<?php 
            echo $cb_category_color;
            ?>
">
      	 	    <?php 
            cb_thumbnail('80', '60');
            echo cb_review_ext_box($cb_post_id, $cb_category_color, true);
            echo $cb_post_format_icon;
            ?>
      	 	</div>
             
            <div class="cb-meta">
                
                <h2 class="h4"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h2>
             
开发者ID:luskyj89,项目名称:mt-wordpress,代码行数:30,代码来源:cb-m-b.php

示例2: post_class

                $cb_feature_height = '300';
                $cb_feature_tile_size = 'cb-m';
            }
        }
        if ($i == 1) {
            echo '<div class="cb-grid-block cb-module-block' . $cb_no_sidebar . ' clearfix">' . $cb_title_header . '<div class="cb-grid-x cb-grid-' . $cb_ppp . ' clearfix">';
        }
        ?>
    <div <?php 
        post_class('cb-grid-feature cb-feature-' . esc_attr($i) . ' ' . esc_attr($cb_feature_tile_size) . ' ' . ot_get_option('cb_grid_tile_design', 'cb-meta-style-4') . ' clearfix');
        ?>
>

        <div class="cb-grid-img">
            <?php 
        cb_thumbnail($cb_feature_width, $cb_feature_height);
        ?>
        </div>

        <div class="cb-article-meta">
            <h2><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
            <?php 
        cb_byline($cb_post_id);
        ?>
       </div>
开发者ID:walkthenight,项目名称:walkthenight-wordpress,代码行数:31,代码来源:cb-grid-x.php

示例3: while

    while ($cb_qry->have_posts()) {
        $cb_qry->the_post();
        $cb_post_id = $post->ID;
        $cb_category_color = cb_get_cat_color($cb_post_id);
        if ($cb_title != NULL) {
            $cb_title_header = '<div class="cb-module-header" style="border-bottom-color:' . $cb_category_color . ';"><h2 class="cb-module-title" >' . $cb_title . '</h2>' . $cb_subtitle . '</div>';
            $cb_title_placeholder = NULL;
        }
        if ($cb_count == 1) {
            echo '<div class="' . $cb_module_type . ' ' . $cb_module_style . ' ' . $cb_title_placeholder . 'clearfix"' . $cb_slider_ltr_rtl . '>' . $cb_title_header . '<div class="' . $cb_slider_type . ' clearfix"><ul class="slides">';
        }
        ?>
        <li>

            <?php 
        cb_thumbnail('282', '232');
        ?>

            <div class="cb-meta">
                <h2><a href="<?php 
        the_permalink();
        ?>
"><?php 
        echo get_the_title();
        ?>
</a></h2>
                <?php 
        echo cb_byline(false, $cb_post_id, true);
        ?>
            </div>
开发者ID:sovanda,项目名称:Valenti,代码行数:30,代码来源:cb-s-1.php

示例4: widget

        function widget($args, $instance)
        {
            $cache = wp_cache_get('widget_popular_posts', 'widget');
            if (!is_array($cache)) {
                $cache = array();
            }
            if (!isset($args['widget_id'])) {
                $args['widget_id'] = $this->id;
            }
            if (isset($cache[$args['widget_id']])) {
                echo $cache[$args['widget_id']];
                return;
            }
            ob_start();
            extract($args);
            $cb_title = empty($instance['cb_title']) ? '' : $instance['cb_title'];
            $cb_category = empty($instance['category']) ? '' : $instance['category'];
            $cb_type = empty($instance['cb_type']) ? 'cb-article-small' : $instance['cb_type'];
            $cb_filter_date = empty($instance['cb_filter_date']) ? 'alltime' : $instance['cb_filter_date'];
            $cb_filter_by = empty($instance['cb_filter_by']) ? 'cb-comments' : $instance['cb_filter_by'];
            if (empty($instance['cb_number']) || !($cb_number = absint($instance['cb_number']))) {
                $cb_number = 5;
            }
            if ($cb_category != 'cb-all') {
                $cb_cat_qry = $cb_category;
            } else {
                $cb_cat_qry = NULL;
            }
            $cb_qry = NULL;
            $cb_c = 300;
            $i = 1;
            if ($cb_filter_by == 'cb-visits') {
                if (function_exists('stats_get_csv')) {
                    if ($cb_filter_date == 'week') {
                        $cb_weekly_qry = 'cb-week-pop';
                        if (($cb_qry = get_transient($cb_weekly_qry)) === false) {
                            $cb_qry = stats_get_csv('postviews', 'days=8&limit=' . (6 + $cb_number));
                            set_transient($cb_weekly_qry, $cb_qry, $cb_c);
                        }
                    } elseif ($cb_filter_date == 'month') {
                        $cb_monthly_qry = 'cb-month-pop';
                        if (($cb_qry = get_transient($cb_monthly_qry)) === false) {
                            $cb_qry = stats_get_csv('postviews', 'days=31&limit=' . (6 + $cb_number));
                            set_transient($cb_monthly_qry, $cb_qry, $cb_c);
                        }
                    } elseif ($cb_filter_date == 'alltime') {
                        $cb_alltime_qry = 'cb-alltime-pop';
                        if (($cb_qry = get_transient($cb_alltime_qry)) === false) {
                            $cb_qry = stats_get_csv('postviews', 'days=-1&limit=' . (6 + $cb_number));
                            set_transient($cb_alltime_qry, $cb_qry, $cb_c);
                        }
                    }
                } else {
                    echo '<div class="cb-sidebar-widget">15Zine Popular Posts Widget: To use the "View Count" option You need to install Jetpack plugin and enable the "Stats" module.</div>';
                }
            } else {
                $cb_cpt_output = cb_get_custom_post_types();
                $cb_qry = new WP_Query(array('post_type' => $cb_cpt_output, 'posts_per_page' => $cb_number, 'category_name' => $cb_cat_qry, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'orderby' => 'comment_count'));
            }
            echo $before_widget;
            $cb_width = '100';
            $cb_height = '65';
            $cb_style = ' cb-separated';
            if ($cb_type == 'cb-article-big') {
                $cb_width = '360';
                $cb_height = '240';
                $cb_style = ' cb-meta-style-2';
            }
            if ($cb_title) {
                echo $before_title . esc_html($cb_title) . $after_title;
            }
            echo '<div class="cb-module-block cb-small-margin">';
            if ($cb_filter_by == 'cb-comments' && $cb_qry->have_posts()) {
                while ($cb_qry->have_posts()) {
                    $cb_qry->the_post();
                    global $post;
                    $cb_post_id = $post->ID;
                    ?>
                    <article <?php 
                    post_class('cb-article ' . esc_attr($cb_type) . ' ' . esc_attr($cb_style) . ' clearfix');
                    ?>
>
                        <div class="cb-mask cb-img-fw" <?php 
                    cb_img_bg_color($cb_post_id);
                    ?>
>
                            <?php 
                    cb_thumbnail($cb_width, $cb_height);
                    ?>
                            <?php 
                    cb_review_ext_box($cb_post_id, true);
                    ?>
                        </div>
                        <div class="cb-meta cb-article-meta">
                            <h4 class="cb-post-title"><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
//.........这里部分代码省略.........
开发者ID:walkthenight,项目名称:walkthenight-wordpress,代码行数:101,代码来源:cb-popular-posts-widget.php

示例5: cb_sidebar_post

    function cb_sidebar_post()
    {
        $cb_sidebar_posts = ot_get_option('cb_sidebar_posts', 'on');
        $cb_sidebar_posts_title = ot_get_option('cb_sidebar_posts_title', NULL);
        $cb_sidebar_posts_filter = ot_get_option('cb_sidebar_posts_filter', 'rand');
        $cb_sidebar_posts_number = ot_get_option('cb_sidebar_posts_number', '2');
        $cb_sidebar_posts_likes = ot_get_option('cb_sidebar_posts_likes', 'on');
        $cb_output = $cb_meta_value = NULL;
        if ($cb_sidebar_posts == 'on') {
            if ($cb_sidebar_posts_filter == 'meta_value_num') {
                $cb_meta_value = 'cb_post_like_count';
            }
            $cb_qry = new WP_Query(array('posts_per_page' => $cb_sidebar_posts_number, 'orderby' => $cb_sidebar_posts_filter, 'meta_key' => $cb_meta_value, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true));
            if ($cb_qry->have_posts()) {
                $cb_post_classes = array('clearfix', 'cb-menu-post', 'cb-' . $cb_sidebar_posts_number);
                echo '<span class="cb-sidebar-post-title cb-sidebar-post-meta">' . $cb_sidebar_posts_title . '</span>';
                while ($cb_qry->have_posts()) {
                    $cb_qry->the_post();
                    global $post;
                    $cb_post_id = $post->ID;
                    ?>
                    <div <?php 
                    post_class($cb_post_classes);
                    ?>
>
                        
                        <div class="cb-mask">
                            <?php 
                    cb_thumbnail($cb_post_id, '550', '430', false);
                    ?>
                        </div>
                        <?php 
                    if ($cb_sidebar_posts_likes == 'on') {
                        echo cb_get_like_count($cb_post_id);
                    }
                    ?>
                        <a href="<?php 
                    the_permalink();
                    ?>
" class="cb-link-overlay"></a>

                    </div>
            <?php 
                }
            }
            wp_reset_postdata();
        }
        echo $cb_output;
    }
开发者ID:TechDevMX,项目名称:BlogJivamukti,代码行数:49,代码来源:core.php

示例6: widget

        function widget($args, $instance)
        {
            $cache = wp_cache_get('widget_recent_posts', 'widget');
            if (!is_array($cache)) {
                $cache = array();
            }
            if (!isset($args['widget_id'])) {
                $args['widget_id'] = $this->id;
            }
            if (isset($cache[$args['widget_id']])) {
                echo $cache[$args['widget_id']];
                return;
            }
            ob_start();
            extract($args);
            $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts', 'cubell') : $instance['title'], $instance, $this->id_base);
            $category = apply_filters('widget_category', empty($instance['category']) ? '' : $instance['category'], $instance, $this->id_base);
            $type = apply_filters('widget_type', empty($instance['type']) ? 'cb-small' : $instance['type'], $instance, $this->id_base);
            if (empty($instance['number']) || !($number = absint($instance['number']))) {
                $number = 5;
            }
            if ($category != 'cb-all') {
                $cb_cat_qry = $category;
            } else {
                $cb_cat_qry = NULL;
            }
            $r = new WP_Query(apply_filters('widget_posts_args', array('posts_per_page' => $number, 'no_found_rows' => true, 'category_name' => $cb_cat_qry, 'post_status' => 'publish', 'ignore_sticky_posts' => true)));
            if ($r->have_posts()) {
                echo $before_widget;
                if ($title) {
                    echo $before_title . $title . $after_title;
                }
                ?>
    		
    		<ul class="cb-light <?php 
                echo $type;
                ?>
">
    		<?php 
                while ($r->have_posts()) {
                    $r->the_post();
                    global $post;
                    $cb_custom_fields = get_post_custom();
                    $cb_global_color = ot_get_option('cb_base_color', '#eb9812');
                    $cb_meta_onoff = ot_get_option('cb_meta_onoff', 'on');
                    $cb_review_checkbox = get_post_meta(get_the_id(), "cb_review_checkbox");
                    if ($type == 'cb-small') {
                        $width = '80';
                        $height = '60';
                        $cb_small_box = true;
                        $cb_class = NULL;
                    }
                    if ($type == 'cb-big') {
                        $width = '360';
                        $height = '240';
                        $cb_small_box = false;
                        $cb_class = ' class="h2"';
                    }
                    $cb_all_categories = get_the_category();
                    $cb_current_cat_id = $cb_all_categories[0]->term_id;
                    $cb_category_color = get_tax_meta($cb_current_cat_id, 'cb_color_field_id');
                    if ($cb_category_color == "#" || $cb_category_color == NULL) {
                        $cb_parent_cat_id = $cb_all_categories[0]->parent;
                        if ($cb_parent_cat_id != '0') {
                            $cb_category_color = get_tax_meta($cb_parent_cat_id, 'cb_color_field_id');
                        }
                        if ($cb_category_color == "#" || $cb_category_color == NULL) {
                            $cb_category_color = $cb_global_color;
                        }
                    }
                    $cb_post_id = $post->ID;
                    $cb_post_format_icon = cb_post_format_check($cb_post_id);
                    ?>
                
                <li class="cb-article clearfix">
                	<div class="cb-mask" style="background-color:<?php 
                    echo $cb_category_color;
                    ?>
;">
                	    <?php 
                    cb_thumbnail($width, $height);
                    echo cb_review_ext_box($cb_post_id, $cb_category_color, $cb_small_box);
                    echo $cb_post_format_icon;
                    ?>
                	</div>
                    <div class="cb-meta">    
                        <h4<?php 
                    echo $cb_class;
                    ?>
><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h4>
                        <?php 
                    echo cb_byline(false, $cb_post_id, true);
                    ?>
                        <?php 
//.........这里部分代码省略.........
开发者ID:luskyj89,项目名称:mt-wordpress,代码行数:101,代码来源:cb-recent-posts-widget.php

示例7: cb_thumbnail

        if (is_sticky()) {
            echo ' sticky';
        }
        echo $cb_side;
        if ($cb_category_color_style != NULL) {
            echo ' ' . $cb_category_color_style;
        }
        ?>
" role="article">

  <div class="cb-mask" style="background-color:<?php 
        echo $cb_category_color;
        ?>
;">
       <?php 
        cb_thumbnail('360', '240');
        echo cb_review_ext_box($cb_post_id, $cb_category_color);
        echo $cb_post_format_icon;
        ?>
  </div>

  <div class="cb-meta">

     <h2 class="h4"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
   	 <?php 
开发者ID:sovanda,项目名称:Valenti,代码行数:31,代码来源:cat-style-b.php

示例8: the_ID

            ?>

    <article id="post-<?php 
            the_ID();
            ?>
" <?php 
            post_class('cb-blog-style-a cb-module-e cb-separated clearfix');
            ?>
 role="article">

        <div class="cb-mask cb-img-fw" <?php 
            cb_img_bg_color($cb_post_id);
            ?>
>
            <?php 
            cb_thumbnail('260', '170');
            ?>
            <?php 
            cb_review_ext_box($cb_post_id);
            ?>
        </div>

        <div class="cb-meta clearfix">

            <h2 class="cb-post-title"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h2>
开发者ID:walkthenight,项目名称:walkthenight-wordpress,代码行数:31,代码来源:blog-style-f.php

示例9: cb_related_posts

    function cb_related_posts()
    {
        global $post;
        $cb_post_id = $post->ID;
        $i = 1;
        $cb_related_posts_amount = floatval(ot_get_option('cb_related_posts_amount', '2'));
        $cb_related_posts_amount_full = $cb_related_posts_amount * 1.5;
        $cb_full_width_post = get_post_meta($cb_post_id, 'cb_full_width_post', true);
        if ($cb_full_width_post == 'nosidebar') {
            $cb_number_related = $cb_related_posts_amount_full;
        } else {
            $cb_number_related = $cb_related_posts_amount;
        }
        $cb_tags = wp_get_post_tags($post->ID);
        $cb_tag_check = $cb_all_cats = $cb_related_args = $cb_related_posts = NULL;
        if ($cb_tags != NULL) {
            foreach ($cb_tags as $cb_tag) {
                $cb_tag_check .= $cb_tag->slug . ',';
            }
            $cb_related_args = array('numberposts' => $cb_number_related, 'tag' => $cb_tag_check, 'exclude' => $cb_post_id, 'post_status' => 'publish', 'orderby' => 'rand');
            $cb_related_posts = get_posts($cb_related_args);
        } else {
            $cb_categories = get_the_category();
            foreach ($cb_categories as $cb_category) {
                $cb_all_cats .= $cb_category->term_id . ',';
            }
            $cb_related_args = array('numberposts' => $cb_number_related, 'category' => $cb_all_cats, 'exclude' => $cb_post_id, 'post_status' => 'publish', 'orderby' => 'rand');
            $cb_related_posts = get_posts($cb_related_args);
        }
        if ($cb_related_posts != NULL) {
            echo '<div id="cb-related-posts" class="clearfix"><h3 class="cb-block-title">' . __('Related Posts', 'cubell') . '</h3><ul>';
            foreach ($cb_related_posts as $post) {
                $cb_post_id = $post->ID;
                $cb_global_color = ot_get_option('cb_base_color', '#eb9812');
                $cb_cat_id = get_the_category();
                if (function_exists('get_tax_meta')) {
                    $cb_current_cat_id = $cb_cat_id[0]->term_id;
                    $cb_category_color = get_tax_meta($cb_current_cat_id, 'cb_color_field_id');
                    if ($cb_category_color == "#" || $cb_category_color == NULL) {
                        $cb_parent_cat_id = $cb_cat_id[0]->parent;
                        if ($cb_parent_cat_id != '0') {
                            $cb_category_color = get_tax_meta($cb_parent_cat_id, 'cb_color_field_id');
                        }
                        if ($cb_category_color == "#" || $cb_category_color == NULL) {
                            $cb_category_color = $cb_global_color;
                        }
                    }
                } else {
                    $cb_category_color = NULL;
                }
                setup_postdata($post);
                ?>
 
                            <li class="no-<?php 
                echo $i;
                ?>
">
                                <div class="cb-mask" style="background-color:<?php 
                echo $cb_category_color;
                ?>
;"><?php 
                cb_thumbnail('360', '240');
                echo cb_review_ext_box($cb_post_id, $cb_category_color);
                ?>
</div>
                                 <div class="cb-meta">
                                     <h4><a href="<?php 
                the_permalink();
                ?>
"><?php 
                echo get_the_title();
                ?>
</a></h4>
                                     <?php 
                echo cb_byline(false);
                ?>
                                </div>
                            </li>
<?php 
                $i++;
            }
            echo '</ul></div>';
            wp_reset_postdata();
        }
    }
开发者ID:luskyj89,项目名称:mt-wordpress,代码行数:85,代码来源:core.php

示例10: widget

        function widget($args, $instance)
        {
            $cache = wp_cache_get('widget_recent_posts', 'widget');
            if (!is_array($cache)) {
                $cache = array();
            }
            if (!isset($args['widget_id'])) {
                $args['widget_id'] = $this->id;
            }
            if (isset($cache[$args['widget_id']])) {
                echo $cache[$args['widget_id']];
                return;
            }
            ob_start();
            extract($args);
            $cb_title = empty($instance['title']) ? '' : $instance['title'];
            $cb_category = empty($instance['category']) ? '' : $instance['category'];
            $cb_type = empty($instance['type']) ? 'cb-small' : $instance['type'];
            if (empty($instance['number']) || !($cb_number = absint($instance['number']))) {
                $cb_number = 5;
            }
            if ($cb_category != 'cb-all') {
                $cb_cat_qry = $cb_category;
            } else {
                $cb_cat_qry = NULL;
            }
            $cb_cpt_output = cb_get_custom_post_types();
            $cb_qry = new WP_Query(array('post_type' => $cb_cpt_output, 'posts_per_page' => $cb_number, 'no_found_rows' => true, 'category_name' => $cb_cat_qry, 'post_status' => 'publish', 'ignore_sticky_posts' => true));
            if ($cb_qry->have_posts()) {
                echo $before_widget;
                if ($cb_title) {
                    echo $before_title . esc_html($cb_title) . $after_title;
                }
                ?>

    		<div class="cb-module-block cb-small-margin">
    		<?php 
                while ($cb_qry->have_posts()) {
                    $cb_qry->the_post();
                    global $post;
                    $cb_post_id = $post->ID;
                    $cb_width = '100';
                    $cb_height = '65';
                    $cb_style = ' cb-separated';
                    $cb_bg_color = cb_get_img_bg_color($cb_post_id);
                    if ($cb_type == 'cb-article-big') {
                        $cb_width = '360';
                        $cb_height = '240';
                        $cb_style = ' cb-meta-style-2';
                        $cb_bg_color = NULL;
                    }
                    ?>
                <article <?php 
                    post_class('cb-looper cb-article ' . esc_attr($cb_type) . ' ' . esc_attr($cb_style) . ' clearfix', $cb_post_id);
                    ?>
>
                    <div class="cb-mask cb-img-fw" <?php 
                    $cb_bg_color;
                    ?>
>
                        <?php 
                    cb_thumbnail($cb_width, $cb_height);
                    ?>
                        <?php 
                    cb_review_ext_box($cb_post_id, true);
                    ?>
                    </div>
                    <div class="cb-meta cb-article-meta">
                        <h4 class="cb-post-title"><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h4>
                        <?php 
                    echo cb_get_byline_date($cb_post_id);
                    ?>
                    </div>
                    <?php 
                    if ($cb_type == 'cb-article-big') {
                        echo '<a href="' . get_the_permalink() . '" class="cb-link"></a>';
                    }
                    ?>
                </article>
    		<?php 
                }
                ?>
    		</div>
    		<?php 
                echo $after_widget;
                ?>
    <?php 
                wp_reset_postdata();
            }
            $cache[$args['widget_id']] = ob_get_flush();
            wp_cache_set('widget_recent_posts', $cache, 'widget');
        }
开发者ID:walkthenight,项目名称:walkthenight-wordpress,代码行数:98,代码来源:cb-recent-posts-widget.php

示例11: cb_thumbnail

" class="cb-blog-style-d clearfix<?php 
        if (is_sticky()) {
            echo ' sticky';
        }
        if ($cb_category_color_style != NULL) {
            echo ' ' . $cb_category_color_style;
        }
        ?>
" role="article">

    <div class="cb-mask" style="background-color:<?php 
        echo $cb_category_color;
        ?>
;">
        <?php 
        cb_thumbnail('750', '400');
        echo cb_review_ext_box($cb_post_id, $cb_category_color);
        echo $cb_post_format_icon;
        ?>
    </div>

    <div class="cb-meta">

        <h2 class="h4"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
        <?php 
开发者ID:sovanda,项目名称:Valenti,代码行数:31,代码来源:cat-style-d.php

示例12: the_ID

        ?>

<article id="post-<?php 
        the_ID();
        ?>
" <?php 
        post_class('cb-blog-style-d cb-module-d cb-separated cb-img-above-meta clearfix');
        ?>
 role="article">
  
    <div class="cb-mask cb-img-fw" <?php 
        cb_img_bg_color($cb_post_id);
        ?>
>
        <?php 
        cb_thumbnail('759', '500');
        ?>
        <?php 
        cb_review_ext_box($cb_post_id);
        ?>
    </div>

    <div class="cb-meta clearfix">

        <h2 class="cb-post-title"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
开发者ID:walkthenight,项目名称:walkthenight-wordpress,代码行数:31,代码来源:blog-style-d.php

示例13: widget

        function widget($args, $instance)
        {
            $cache = wp_cache_get('widget_recent_posts_slider', 'widget');
            if (!is_array($cache)) {
                $cache = array();
            }
            if (!isset($args['widget_id'])) {
                $args['widget_id'] = $this->id;
            }
            if (isset($cache[$args['widget_id']])) {
                echo $cache[$args['widget_id']];
                return;
            }
            ob_start();
            extract($args);
            $cb_title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base);
            $cb_category = apply_filters('widget_category', empty($instance['category']) ? '' : $instance['category'], $instance, $this->id_base);
            if (empty($instance['number']) || !($cb_number = absint($instance['number']))) {
                $cb_number = 6;
            }
            if ($cb_category != 'cb-all') {
                $cb_cat_qry = $cb_category;
            } else {
                $cb_cat_qry = NULL;
            }
            $cb_cpt_output = cb_get_custom_post_types();
            $cb_qry = new WP_Query(array('post_type' => $cb_cpt_output, 'posts_per_page' => $cb_number, 'no_found_rows' => true, 'category_name' => $cb_cat_qry, 'post_status' => 'publish', 'ignore_sticky_posts' => true));
            if ($cb_qry->have_posts()) {
                echo $before_widget;
                if ($cb_title) {
                    echo $before_title . esc_html($cb_title) . $after_title;
                }
                ?>
    		<div class="cb-slider cb-slider-1 cb-recent-slider cb-relative cb-arrows-tr clearfix">
        		<ul class="slides">

        		<?php 
                while ($cb_qry->have_posts()) {
                    $cb_qry->the_post();
                    global $post;
                    $cb_post_id = $post->ID;
                    ?>
                    <li <?php 
                    post_class('cb-article cb-style-1 clearfix');
                    ?>
>

                        <div class="cb-mask"><?php 
                    cb_thumbnail('360', '240', $cb_post_id);
                    ?>
</div>

                        <div class="cb-meta">
                            <h4 class="cb-post-title"><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h4>
                            <?php 
                    echo cb_get_byline_date($cb_post_id);
                    ?>
                        </div>

                    </li>
        		<?php 
                }
                ?>
        		</ul>
    		</div>

    		<?php 
                echo $after_widget;
                wp_reset_postdata();
            }
            $cache[$args['widget_id']] = ob_get_flush();
            wp_cache_set('widget_recent_posts_slider', $cache, 'widget');
        }
开发者ID:walkthenight,项目名称:walkthenight-wordpress,代码行数:79,代码来源:cb-recent-posts-slider-widget.php

示例14: cb_related_posts

    function cb_related_posts()
    {
        if (ot_get_option('cb_related_onoff', 'on') == 'off') {
            return;
        }
        global $post;
        $cb_post_id = $post->ID;
        $i = 1;
        $cb_slide_el = $cb_slide_el_cl = $cb_stop_at_2 = NULL;
        $cb_related_posts_show = ot_get_option('cb_related_posts_show', 'both');
        $cb_related_posts_order = ot_get_option('cb_related_posts_order', 'rand');
        $cb_related_posts_style = ot_get_option('cb_related_posts_style', 'cb_related_posts_slider');
        if ($cb_related_posts_style == 'cb_related_posts_slider') {
            $cb_related_posts_amount = 8;
            $cb_slide_el = '<div id="cb-related-posts" class="cb-slider-2 cb-slider cb-meta-below">';
            $cb_slide_el_cl = '</div>';
        } else {
            $cb_related_posts_amount = floatval(ot_get_option('cb_related_posts_amount', '1') * 2);
        }
        $cb_tags = wp_get_post_tags($cb_post_id);
        $cb_tag_check = $cb_all_cats = $cb_related_args = $cb_related_posts = NULL;
        if ($cb_related_posts_show == 'both' || $cb_related_posts_show == 'tags') {
            if ($cb_tags != NULL) {
                foreach ($cb_tags as $cb_tag) {
                    $cb_tag_check .= $cb_tag->slug . ',';
                }
                $cb_related_args = array('numberposts' => $cb_related_posts_amount, 'tag' => $cb_tag_check, 'exclude' => $cb_post_id, 'post_status' => 'publish', 'orderby' => $cb_related_posts_order);
                $cb_related_posts = get_posts($cb_related_args);
            }
        }
        if ($cb_related_posts_show == 'both' || $cb_related_posts_show == 'cats') {
            if ($cb_related_posts == NULL) {
                $cb_categories = get_the_category();
                foreach ($cb_categories as $cb_category) {
                    $cb_all_cats .= $cb_category->term_id . ',';
                }
                $cb_related_args = array('numberposts' => $cb_related_posts_amount, 'category' => $cb_all_cats, 'exclude' => $cb_post_id, 'post_status' => 'publish', 'orderby' => $cb_related_posts_order);
                $cb_related_posts = get_posts($cb_related_args);
            }
        }
        if ($cb_related_posts != NULL) {
            if (count($cb_related_posts) < 4) {
                $cb_slide_el = $cb_slide_el_cl = NULL;
                $cb_stop_at_2 = true;
            }
            echo '<div id="cb-related-posts-block" class="cb-post-footer-block cb-arrows-tr cb-module-block clearfix"><h3 class="cb-title cb-title-header">' . __('Related Posts', 'cubell') . '</h3>' . $cb_slide_el . '<ul class="slides clearfix">';
            foreach ($cb_related_posts as $post) {
                if ($i == 3) {
                    $i = 1;
                    if ($cb_stop_at_2 == true) {
                        break;
                    }
                }
                $cb_post_id = $post->ID;
                setup_postdata($post);
                ?>
                <li <?php 
                post_class('cb-style-1 clearfix cb-no-' . $i);
                ?>
>
                    <div class="cb-mask"><?php 
                cb_thumbnail('360', '240', $post->ID);
                ?>
</div>
                    <div class="cb-meta">
                        <h4 class="cb-post-title"><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h4>
                        <?php 
                cb_byline($cb_post_id);
                ?>
                    </div>
                </li>
<?php 
                $i++;
            }
            echo '</ul></div>';
            echo $cb_slide_el_cl;
            wp_reset_postdata();
        }
    }
开发者ID:walkthenight,项目名称:walkthenight-wordpress,代码行数:85,代码来源:core.php

示例15: cb_thumbnail

        if (is_sticky()) {
            echo ' sticky';
        }
        if ($cb_category_color_style != NULL) {
            echo ' ' . $cb_category_color_style;
        }
        ?>
" role="article">

  <div class="cb-mask" style="background-color:<?php 
        echo $cb_category_color;
        ?>
;">

    <?php 
        cb_thumbnail('300', '200');
        echo cb_review_ext_box($cb_post_id, $cb_category_color);
        echo $cb_post_format_icon;
        ?>

  </div>

  <div class="cb-meta">

      <h2 class="h4"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
开发者ID:sovanda,项目名称:Valenti,代码行数:31,代码来源:cat-style-a.php


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