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

PHP vc_build_loop_query函数代码示例

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

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



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

示例1: content

 protected function content($atts, $content = null)
 {
     $atts = shortcode_atts(array('element_id' => '', 'source' => '', 'cell_height' => 120, 'space' => 20, 'template' => '', 'class' => ''), $atts);
     /**
      * Enqueue script
      */
     LemonGrid::include_script();
     $templateParams = json_decode($atts['template'], true);
     $atts['class_id'] = 'lemon_grid_id_' . $atts['element_id'];
     $atts['template'] = $templateParams['template'];
     $atts['template_params'] = $templateParams;
     /**
      * wp_query
      */
     list($args, $wp_query) = vc_build_loop_query($atts['source']);
     $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1;
     if ($paged > 1) {
         $args['paged'] = $paged;
         $wp_query = new WP_Query($args);
     }
     $atts['posts'] = $wp_query;
     wp_enqueue_style('tb-lemongrid-custom-script', TB_CSS . 'lemongrid-custom-script.css');
     wp_add_inline_style('tb-lemongrid-custom-script', renderGridCustomSpaceCss($atts['class_id'], $atts['space']));
     return lgLoadTemplate($atts, $content);
 }
开发者ID:BearsTheme,项目名称:lemongrid,代码行数:25,代码来源:post_lemongrid.php


示例2: getLoop

 protected function getLoop($loop)
 {
     global $vc_posts_grid_exclude_id;
     $vc_posts_grid_exclude_id[] = get_the_ID();
     require_once vc_path_dir('PARAMS_DIR', 'loop/loop.php');
     list($this->loop_args, $this->query) = vc_build_loop_query($loop, $vc_posts_grid_exclude_id);
 }
开发者ID:walkthenight,项目名称:walkthenight-wordpress,代码行数:7,代码来源:vc-posts-grid.php


示例3: content

 protected function content($atts, $content = null)
 {
     //default value
     $atts_extra = shortcode_atts(array('xsmall_items' => 1, 'small_items' => 2, 'medium_items' => 3, 'large_items' => 4, 'margin' => 0, 'loop' => 1, 'mousedrag' => 1, 'touchdrag' => 1, 'nav' => 1, 'dots' => 1, 'center' => 0, 'autoplay' => 1, 'autoplaytimeout' => '5000', 'smartspeed' => '250', 'autoplayhoverpause' => 1, 'left_arrow' => 'fa fa-arrow-left', 'right_arrow' => 'fa fa-arrow-right', 'filter' => "false", 'class' => ''), $atts);
     global $zo_carousel;
     $atts = array_merge($atts_extra, $atts);
     wp_enqueue_style('owl-carousel', ZO_CSS . 'owl.carousel.css', '', '2.0.0b', 'all');
     wp_enqueue_script('owl-carousel', ZO_JS . 'owl.carousel.js', array('jquery'), '2.0.0b', true);
     wp_enqueue_script('owl-autoplay', ZO_JS . 'owl.autoplay.js', array('jquery'), '2.0.0b', true);
     wp_enqueue_script('owl-navigation', ZO_JS . 'owl.navigation.js', array('jquery'), '2.0.0b', true);
     wp_enqueue_script('owl-animate', ZO_JS . 'owl.animate.js', array('jquery'), '2.0.0b', true);
     wp_enqueue_script('owl-carousel-zo', ZO_JS . 'owl.carousel.zo.js', array('jquery'), '1.0.0', true);
     $source = $atts['source'];
     list($args, $posts) = vc_build_loop_query($source);
     $atts['posts'] = $posts;
     $html_id = zoHtmlID('zo-carousel');
     $atts['autoplaytimeout'] = isset($atts['autoplaytimeout']) ? (int) $atts['autoplaytimeout'] : 5000;
     $atts['smartspeed'] = isset($atts['smartspeed']) ? (int) $atts['smartspeed'] : 250;
     $left_arrow = isset($atts['left_arrow']) ? $atts['left_arrow'] : 'fa fa-arrow-left';
     $right_arrow = isset($atts['right_arrow']) ? $atts['right_arrow'] : 'fa fa-arrow-right';
     $zo_carousel[$html_id] = array('margin' => (int) $atts['margin'], 'loop' => $atts['loop'] == 1 ? true : false, 'mouseDrag' => $atts['mousedrag'] == 1 ? true : false, 'touchDrag' => $atts['touchdrag'] == 1 ? true : false, 'nav' => $atts['nav'] == 1 ? true : false, 'dots' => $atts['dots'] == 1 ? true : false, 'center' => $atts['center'] == 1 ? true : false, 'autoplay' => $atts['autoplay'] == 1 ? true : false, 'autoplayTimeout' => $atts['autoplaytimeout'], 'smartSpeed' => $atts['smartspeed'], 'autoplayHoverPause' => $atts['autoplayhoverpause'] == 1 ? true : false, 'navText' => array('<i class="' . $left_arrow . '"></i>', '<i class="' . $right_arrow . '"></i>'), 'dotscontainer' => $html_id . ' .zo-dots', 'items' => (int) $atts['large_items'], 'responsive' => array(0 => array("items" => (int) $atts['xsmall_items']), 768 => array("items" => (int) $atts['small_items']), 992 => array("items" => (int) $atts['medium_items']), 1200 => array("items" => (int) $atts['large_items'])));
     wp_localize_script('owl-carousel-zo', "zocarousel", $zo_carousel);
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['zo_template']) . ' ' . $atts['class'];
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }
开发者ID:lenguyenitc,项目名称:donations,代码行数:26,代码来源:zo_carousel.php


示例4: content

 protected function content($atts, $content = null)
 {
     $html_id = tbHtmlID('tb-masonry');
     $source = $atts['source'];
     list($args, $wp_query) = vc_build_loop_query($source);
     $atts['cat'] = isset($args['cat']) ? $args['cat'] : '';
     /* get posts */
     $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1;
     if ($paged > 1) {
         $args['paged'] = $paged;
         $wp_query = new WP_Query($args);
     }
     $atts['posts'] = $wp_query;
     $grid = shortcode_atts(array('col_lg' => 4, 'col_md' => 3, 'col_sm' => 2, 'col_xs' => 1, 'layout' => 'basic', 'margin' => 0, 'ratio' => 0.5), $atts);
     $atts['item_class'] = "tb-masonry-item";
     $class = isset($atts['class']) ? $atts['class'] : '';
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['tb_template']) . ' ' . $class;
     $atts['post_id'] = get_the_ID();
     $atts['html_id'] = $html_id;
     //Masonry Settings
     global $tb_masonry;
     $tb_masonry[$html_id] = array('post_id' => get_the_ID(), 'grid_margin' => (int) $atts['margin'], 'grid_ratio' => (double) $atts['ratio'], 'grid_cols_xs' => (int) $grid['col_xs'], 'grid_cols_sm' => (int) $grid['col_sm'], 'grid_cols_md' => (int) $grid['col_md'], 'grid_cols_lg' => (int) $grid['col_lg']);
     wp_localize_script('tb-masonry', "tbMasonry", $tb_masonry);
     wp_enqueue_script('tb-masonry');
     if (current_user_can('manage_options')) {
         wp_enqueue_script('jquery-ui-resizable');
         wp_enqueue_style('tb-jquery-ui');
         wp_enqueue_script('tb-masonry-admin');
     }
     return parent::content($atts, $content);
 }
开发者ID:BearsTheme,项目名称:leonard,代码行数:31,代码来源:tb_masonry.php


示例5: content

 protected function content($atts, $content = null)
 {
     wp_enqueue_script('tb-grid-pagination', TB_JS . 'tbgrid.pagination.js', array('jquery'), '1.0.0', true);
     $html_id = tbHtmlID('tb-grid');
     $source = $atts['source'];
     list($args, $wp_query) = vc_build_loop_query($source);
     $paged = get_query_var('paged') ? intval(get_query_var('paged')) : 1;
     if ($paged > 1) {
         $args['paged'] = $paged;
         $wp_query = new WP_Query($args);
     }
     $atts['cat'] = isset($args['cat']) ? $args['cat'] : '';
     /* get posts */
     $atts['posts'] = $wp_query;
     $grid = shortcode_atts(array('col_lg' => 4, 'col_md' => 3, 'col_sm' => 2, 'col_xs' => 1, 'layout' => 'basic'), $atts);
     $col_lg = 12 / $grid['col_lg'];
     $col_md = 12 / $grid['col_md'];
     $col_sm = 12 / $grid['col_sm'];
     $col_xs = 12 / $grid['col_xs'];
     $atts['item_class'] = "tb-grid-item col-lg-{$col_lg} col-md-{$col_md} col-sm-{$col_sm} col-xs-{$col_xs}";
     $atts['grid_class'] = "tb-grid";
     $class = isset($atts['class']) ? $atts['class'] : '';
     $atts['template'] = 'template-' . str_replace('.php', '', $atts['tb_template']) . ' ' . $class;
     if ($grid['layout'] == 'masonry') {
         wp_enqueue_script('tb-jquery-shuffle');
         $atts['grid_class'] .= " tb-grid-{$grid['layout']}";
     }
     $atts['html_id'] = $html_id;
     return parent::content($atts, $content);
 }
开发者ID:BearsTheme,项目名称:leonard,代码行数:30,代码来源:tb_grid.php


示例6: getLoop

 protected function getLoop($loop)
 {
     list($this->loop_args, $this->query) = vc_build_loop_query($loop, get_the_ID());
 }
开发者ID:ksingh812,项目名称:thub-old,代码行数:4,代码来源:posts_grid.php


示例7: array

<?php

$title = $grid_columns_count = $grid_layout = $grid_link = $grid_link_target = '';
$grid_template = $grid_thumb_size = $grid_layout_mode = '';
$grid_content = $el_class = $width = $orderby = $order = $el_position = $isotope_item = $teasers = $taxonomies = '';
$output = $loop = '';
$template_path = '';
$teaser_categories = array();
extract(shortcode_atts(array('title' => '', 'grid_columns_count' => 4, 'grid_teasers_count' => 8, 'grid_layout' => 'title_thumbnail_text', 'grid_link' => 'link_post', 'grid_link_target' => '_self', 'grid_template' => 'grid', 'grid_thumb_size' => 'thumbnail', 'grid_layout_mode' => 'fitRows', 'grid_content' => 'teaser', 'el_class' => '', 'width' => '1/1', 'orderby' => NULL, 'order' => 'DESC', 'loop' => ''), $atts));
list($args, $my_query) = vc_build_loop_query($loop);
//
/**
 * Enqueue isotope js/css if required
 * {{
 */
if ($grid_template == 'grid' || $grid_template == 'filtered_grid') {
    wp_enqueue_style('isotope-css');
    wp_enqueue_script('isotope');
    $isotope_item = 'isotope-item ';
} else {
    if ($grid_template == 'carousel') {
        wp_enqueue_script('jcarousellite');
        $isotope_item = '';
    }
}
// }}
/**
 * Enqueue prettyphoto js/css if required.
 * {{
 */
if ($grid_link == 'link_image' || $grid_link == 'link_image_post') {
开发者ID:KurtMakesWeb,项目名称:CandG,代码行数:31,代码来源:vc_posts_grid.php


示例8: content

    public function content($atts, $content = null)
    {
        if (!is_shop_supported()) {
            return '';
        }
        extract(shortcode_atts(array('products_query' => '', 'product_types_to_show' => '', 'columns' => '', 'auto_rotate' => '', 'el_class' => '', 'css' => ''), $atts));
        $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'lab-vc-products-carousel woocommerce shop wpb_content_element products-hidden ' . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base'], $atts);
        if ($columns == 1) {
            $css_class .= ' single-column';
        }
        list($args, $products) = vc_build_loop_query($products_query);
        # Show Featured Products Only
        if ($product_types_to_show == 'only_featured') {
            $args['meta_key'] = '_featured';
            $args['meta_value'] = 'yes';
            $products = new WP_Query($args);
        } else {
            # Show Products on Sale Only
            if ($product_types_to_show == 'only_on_sale') {
                $args['meta_query'] = array('relation' => 'OR', array('key' => '_sale_price', 'value' => 0, 'compare' => '>', 'type' => 'numeric'), array('key' => '_min_variation_sale_price', 'value' => 0, 'compare' => '>', 'type' => 'numeric'));
                $products = new WP_Query($args);
            }
        }
        $rand_id = "el_" . time() . mt_rand(10000, 99999);
        $columns = absint($columns);
        wp_enqueue_script('slick');
        wp_enqueue_style('slick');
        ob_start();
        add_filter('get_data_shop_loop_masonry', '__return_false', 100);
        ?>
		<div class="<?php 
        echo $css_class;
        ?>
" id="<?php 
        echo $rand_id;
        ?>
">

			<div class="shop-loading-products">
				<?php 
        _e('Loading products...', 'kalium');
        ?>
			</div>

			<?php 
        add_filter('lab_wc_product_grid_columns', '__return_false');
        if ($products->have_posts()) {
            ?>
	
				<?php 
            woocommerce_product_loop_start();
            ?>
	
					<?php 
            while ($products->have_posts()) {
                $products->the_post();
                ?>
	
						<?php 
                wc_get_template_part('content', 'product');
                ?>
	
					<?php 
            }
            // end of the loop.
            ?>
	
				<?php 
            woocommerce_product_loop_end();
            ?>
	
			<?php 
        }
        remove_filter('lab_wc_product_grid_columns', '__return_false');
        wp_reset_postdata();
        ?>
			
		</div>
		
		<script type="text/javascript">
			jQuery( document ).ready( function( $ ) {
				
				var $productsCarouselContainer = $( '#<?php 
        echo $rand_id;
        ?>
' ),
					$productsCarousel = $productsCarouselContainer.find( '.products' );
				
				$productsCarouselContainer.removeClass( 'products-hidden' );

				$productsCarousel.slick( {
					infinite: false,
					slidesToShow: <?php 
        echo $columns;
        ?>
,
					slidesToScroll: 1,					
					prevArrow: '<span class="nextprev-arrow ss-prev"><i class="flaticon-arrow427"></i></span>',
					nextArrow: '<span class="nextprev-arrow ss-next"><i class="flaticon-arrow413"></i></span>',
					adaptiveHeight: true,				
//.........这里部分代码省略.........
开发者ID:adrienlementheour,项目名称:AliceRouat,代码行数:101,代码来源:init.php


示例9: getLoop

	protected function getLoop( $loop ) {
		require_once vc_path_dir( 'PARAMS_DIR', 'loop/loop.php' );
		list( $this->loop_args, $this->query ) = vc_build_loop_query( $loop, get_the_ID() );
	}
开发者ID:verbazend,项目名称:AWFA,代码行数:4,代码来源:vc-posts-grid.php


示例10: widget

 function widget()
 {
     global $xt_global_where, $wpdb;
     $query_args = array('post_type' => 'post', 'posts_per_page' => $this->instance['number'], 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true);
     if (!empty($this->instance['query_type'])) {
         $query_type = $this->instance['query_type'];
         if ($query_type == 'most-viewed') {
             $query_args['meta_key'] = 'xt_post_views_count';
             $query_args['orderby'] = 'meta_value_num';
             $query_args['order'] = 'DESC';
         } else {
             if ($query_type == 'most-liked') {
                 $query_args['meta_key'] = '_votes_likes';
                 $query_args['orderby'] = 'meta_value_num';
                 $query_args['order'] = 'DESC';
             } else {
                 if ($query_type == 'most-discussed') {
                     $query_args['orderby'] = 'comment_count';
                     $query_args['order'] = 'DESC';
                     if (!empty($this->instance['must_have_comments'])) {
                         $xt_global_where = "AND {$wpdb->posts}.comment_count > 0";
                     }
                 } else {
                     if ($query_type == 'selection' && !empty($this->instance['include_posts'])) {
                         $selection = $this->instance['include_posts'];
                         if (!is_array($selection)) {
                             $selection = explode(",", $selection);
                         }
                         $query_args["post__in"] = $selection;
                         $query_args['orderby'] = 'post__in';
                         $this->instance['category'] = false;
                         $this->instance['number'] = false;
                         $this->instance['query_post_formats'] = false;
                         $this->instance['format'] = false;
                         $query_args["posts_per_page"] = -1;
                     } else {
                         if ($query_type == 'custom') {
                             list($query_args, $query) = vc_build_loop_query($this->instance['custom_query'], get_the_ID());
                         }
                     }
                 }
             }
         }
     }
     if ($query_type != 'custom') {
         if (!empty($this->instance['query_post_formats'])) {
             if (!empty($this->instance['format'])) {
                 $format = $this->instance['format'];
                 if (!is_array($format)) {
                     $format = explode(",", $format);
                 }
                 $query_args['tax_query'] = array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => $format, 'operator' => 'IN'));
             }
         } else {
             if ($query_type != 'selection') {
                 $exclude_formats = xt_get_post_formats(true);
                 $query_args['tax_query'] = array(array('taxonomy' => 'post_format', 'field' => 'slug', 'terms' => $exclude_formats, 'operator' => 'NOT IN'));
             }
         }
         if (!empty($this->instance['category']) || !empty($this->instance['exclude_category'])) {
             $categories = array();
             if (!empty($this->instance['category'])) {
                 $category = $this->instance['category'];
                 if (!is_array($category)) {
                     $category = explode(",", $category);
                 }
                 $categories = array_merge($categories, $category);
             }
             if (!empty($this->instance['exclude_category'])) {
                 $category = $this->instance['exclude_category'];
                 if (!is_array($category)) {
                     $category = explode(",", $category);
                 }
                 foreach ($category as $key => $cat) {
                     $category[$key] = -$cat;
                 }
                 $categories = array_merge($categories, $category);
             }
             if (!empty($categories)) {
                 if (is_array($categories)) {
                     $categories = implode(",", $categories);
                 }
                 $query_args["cat"] = $categories;
             }
         }
     }
     if ($query_type != 'custom') {
         $query = new WP_Query(apply_filters('xt_widget_news_args', $query_args));
     }
     if ($query->have_posts()) {
         $this->query = $query;
         $action_title = $this->instance['action_title'];
         $action_obj_id = $this->instance['action_obj_id'];
         $action_ext_link = $this->instance['action_ext_link'];
         /***/
         $action = $this->actionLink($action_obj_id, $action_ext_link, $action_title);
         if (!empty($this->instance['title'])) {
             echo '<span class="heading-t3"></span>';
             echo '<h3 class="widgettitle">' . $this->instance['title'] . ' ' . $action . '</h3>';
             echo '<span class="heading-b3"></span>';
//.........这里部分代码省略.........
开发者ID:venturepact,项目名称:blog,代码行数:101,代码来源:XT_Widget_Advanced_News.php


示例11: content

    protected function content($atts, $content = null)
    {
        extract(shortcode_atts(array('loop' => '', 'columns_num' => '1', 'style' => '1'), $atts));
        // $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), $this->settings['base'], $atts );
        switch ($columns_num) {
            case '1':
                $col_class = 'col_1';
                break;
            case '2':
                $col_class = 'col_2';
                break;
            case '3':
                $col_class = 'col_3';
                break;
            case '4':
                $col_class = 'col_4';
                break;
            default:
                $col_class = 'col_2';
                break;
        }
        list($args, $loop) = vc_build_loop_query($loop);
        $my_query = new WP_Query($args);
        ob_start();
        ?>

		<div class="posts_wrap_section">
			<?php 
        if ($my_query->have_posts()) {
            while ($my_query->have_posts()) {
                $my_query->the_post();
                ?>
			   		<?php 
                if ($style == '1' || $style == '2' || $style == '5') {
                    ?>
			   			<div class="post_holder match-me <?php 
                    echo esc_attr($col_class);
                    ?>
">
			   				<?php 
                    if ($style == '1') {
                        ?>
			   					<?php 
                        if (has_post_thumbnail()) {
                            echo '<a href="' . get_permalink() . '">' . get_the_post_thumbnail(get_the_ID(), 'global') . '</a>';
                        }
                        ?>
			   				<?php 
                    } else {
                        ?>
			   					<?php 
                        if (has_post_thumbnail()) {
                            ?>
			   						<a href="<?php 
                            the_permalink();
                            ?>
">
			   						<?php 
                            if ($style == '2') {
                                ?>
			   							<div class="style_two_hover">
			   								<div class="post_metas"><?php 
                                $term_list = wp_get_post_terms(get_the_ID(), 'category', array("fields" => "names"));
                                foreach ($term_list as $name) {
                                    echo esc_html($name) . " ";
                                }
                                ?>
</div>
			   								<h1><?php 
                                the_title();
                                ?>
</h1>
			   							</div>
			   						<?php 
                            }
                            ?>
			   							<?php 
                            the_post_thumbnail('global');
                            ?>
			   						</a>
			   					<?php 
                        }
                        ?>
			   				<?php 
                    }
                    ?>
			   				<div class="post_holder_content <?php 
                    echo $style == 2 ? 'style_two' : '';
                    ?>
 <?php 
                    echo $style == 5 ? 'absolute_wrap_content' : '';
                    ?>
">
			   					<?php 
                    if ($style != '2') {
                        ?>
			   						<div class="post_metas"><?php 
                        echo get_the_term_list(get_the_ID(), 'category', '', ', ', '');
                        ?>
</div>
//.........这里部分代码省略.........
开发者ID:estrategasdigitales,项目名称:Dagutorio,代码行数:101,代码来源:posts-loop.php


示例12: shortcode_atts

 * @since      1.0.0
 *
 * @author     8guild
 * @package    Appica
 * @subpackage Core
 */
if (!function_exists('vc_path_dir') || !function_exists('vc_build_loop_query')) {
    return;
}
$a = shortcode_atts(array('loop' => '', 'extra_class' => ''), $atts);
$extra = Appica_Helpers::get_class_set($a['extra_class']);
if ('' === $a['loop']) {
    return;
}
require_once vc_path_dir('PARAMS_DIR', 'loop/loop.php');
list($loop_args, $query) = vc_build_loop_query($a['loop']);
if ($query->have_posts()) {
    ?>

	<div class="masonry-grid">
		<div class="grid-sizer"></div>
		<div class="gutter-sizer"></div>

		<?php 
    while ($query->have_posts()) {
        $query->the_post();
        ?>

			<div id="post-<?php 
        the_ID();
        ?>
开发者ID:narendra-addweb,项目名称:m1,代码行数:31,代码来源:appica_posts.php


示例13: extract

<?php

$output = $template = $title = $loop = $posts_clauses = $only_content = $carousel = $item_margin = $posts_per_item = $el_class = $css = '';
extract(shortcode_atts(array('title' => '', 'loop' => '', 'posts_clauses' => '', 'template' => 'post', 'only_content' => false, 'carousel' => false, 'item_margin' => 0, 'posts_per_item' => 1, 'el_class' => '', 'css' => ''), $atts));
$el_class = $this->getExtraClass($el_class);
$css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base'], $atts);
global $vc_posts_grid_exclude_id;
$vc_posts_grid_exclude_id[] = get_the_ID();
require_once vc_path_dir('PARAMS_DIR', 'loop/loop.php');
list($loop_args, $query) = vc_build_loop_query($loop, $vc_posts_grid_exclude_id);
$loop_args['ignore_sticky_posts'] = true;
if (!empty($posts_clauses) && function_exists('posts_clauses')) {
    add_filter('posts_clauses', $posts_clauses);
}
$query = new WP_Query($loop_args);
if (!empty($posts_clauses) && function_exists('posts_clauses')) {
    remove_filter('posts_clauses', $posts_clauses);
}
if ($carousel) {
    wp_enqueue_script('owl.carousel');
    wp_enqueue_style('owl.carousel');
}
if ($query->have_posts()) {
    $options = get_option(AZEXO_THEME_NAME);
    if ($only_content) {
        $size = array('width' => '', 'height' => '');
    } else {
        $thumbnail_size = isset($options[$template . '_thumbnail_size']) && !empty($options[$template . '_thumbnail_size']) ? $options[$template . '_thumbnail_size'] : 'large';
        azexo_add_image_size($thumbnail_size);
        $size = get_image_sizes($thumbnail_size);
    }
开发者ID:mauricioabisay,项目名称:loc,代码行数:31,代码来源:azexo_posts_list.php


示例14: array

<?php

global $vc_teaser_box;
$posts_query = $el_class = $args = $my_query = $speed = $mode = $swiper_options = '';
$content = $link = $layout = $thumb_size = $link_target = $slides_per_view = $wrap = '';
$autoplay = $hide_pagination_control = $hide_prev_next_buttons = $title = '';
$posts = array();
$atts = vc_map_get_attributes($this->getShortcode(), $atts);
extract($atts);
list($args, $my_query) = vc_build_loop_query($posts_query);
//
$teaser_blocks = vc_sorted_list_parse_value($layout);
while ($my_query->have_posts()) {
    $my_query->the_post();
    // Get post from query
    $post = new stdClass();
    // Creating post object.
    $post->id = get_the_ID();
    $post->link = get_permalink($post->id);
    $post->post_type = get_post_type();
    if ($vc_teaser_box->getTeaserData('enable', $post->id) === '1') {
        $post->custom_user_teaser = true;
        $data = $vc_teaser_box->getTeaserData('data', $post->id);
        if (!empty($data)) {
            $data = json_decode($data);
        }
        $post->bgcolor = $vc_teaser_box->getTeaserData('bgcolor', $post->id);
        $post->custom_teaser_blocks = array();
        $post->title_attribute = the_title_attribute('echo=0');
        if (!empty($data)) {
            foreach ($data as $block) {
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:31,代码来源:vc_carousel.php


示例15: content

        protected function content($atts, $content = null)
        {
            global $ivan_custom_css;
            // Extract shortcode attributes
            extract(shortcode_atts(array('loop' => '', 'ivan_columns' => '4', 'ivan_type' => 'mansory', 'ivan_margin' => '', 'ivan_opacity' => '', 'ivan_zoom' => '', 'ivan_grayscale' => '', 'ivan_cover' => '', 'ivan_cover_hover' => '', 'ivan_img_size' => 'large', 'ivan_custom_height' => '', 'ivan_enable_thumb' => 'yes', 'ivan_enable_cover' => 'yes', 'ivan_enable_title' => 'yes', 'ivan_enable_categories' => 'yes', 'ivan_enable_excerpt' => '', 'ivan_enable_read_more' => '', 'ivan_enable_read_more_txt' => 'READ MORE', 'ivan_carousel_nav' => 'yes', 'ivan_carousel_bullets' => 'yes', 'ivan_enable_sizes' => 'no', 'el_class' => ''), $atts));
            if (empty($loop)) {
                return;
            }
            $output = '';
            $loop_args = array();
            $query = false;
            list($loop_args, $query) = vc_build_loop_query($loop, get_the_ID());
            //$output .= '<div>'.var_export($loop_args, true).'</div>';
            if (!$query) {
                return;
            }
            // Output customizer rules
            foreach ($this->selectors as $key => $value) {
                if (isset($atts[$key]) && '' != $atts[$key]) {
                    preg_match("!\\{\\s*([^\\}]+)\\s*\\}!", $atts[$key], $match);
                    if (!empty($match[0])) {
                        $this->prefix = str_replace(array('{', '}'), '', $match[0]) . ' ';
                        $atts[$key] = str_replace($match[0], "", $atts[$key]);
                    }
                }
            }
            $ivan_query = $query;
            $colNumber = $ivan_columns;
            $columns = 12 / $colNumber;
            // 12 Bootstrap Columns / number of columns
            // Container
            $type = $ivan_type;
            $containerClass = 'ivan-projects ivan-posts ivan-projects-' . $type;
            $containerClass .= ' row';
            $containerClass .= $ivan_margin;
            // If prefix is not defined
            if ('' == $this->prefix) {
                $this->prefix = 'vc_custom_' . rand(25, 15000);
            }
            $output .= '<div class="ivan-projects-main-wrapper ivan-posts-main-wrapper ' . str_replace('.', '', $this->prefix) . '">';
            $additionalClass = '';
            $additionalClass .= $ivan_opacity;
            $additionalClass .= $ivan_zoom;
            $additionalClass .= $ivan_cover;
            $additionalClass .= $ivan_cover_hover;
            if ('yes' == $ivan_grayscale) {
                $additionalClass .= ' gray-enabled';
            }
            if ($ivan_query->have_posts()) {
                if ('carousel' == $type) {
                    wp_enqueue_script('ivan_owl_carousel');
                    wp_enqueue_style('ivan_owl_carousel');
                    $columns = 12;
                }
                wp_enqueue_style('ivan_vc_projects');
                wp_enqueue_script('ivan_vc_projects');
                $output .= '<div class="' . $containerClass . '">';
                $output .= '<div class="gutter-sizer"></div>';
                // Carousel Markup
                if ('carousel' == $type) {
                    $output .= '<div class="owl-carousel">';
                }
                ob_start();
                while ($ivan_query->have_posts()) {
                    $ivan_query->the_post();
                    $singleColumn = $columns;
                    $singleTags = '';
                    // If mansory, apply custom tags to change size
                    if ('mansory' == $type && 'yes' == $ivan_enable_sizes) {
                        $_tags = get_the_tags(get_the_ID());
                        if ($_tags) {
                            foreach ($_tags as $_tag) {
                                if ($_tag->name == 'double') {
                                    if ($singleColumn == 4) {
                                        // 3 Cols
                                        $singleColumn = 8;
                                    } else {
                                        if ($singleColumn == 3) {
                                            // 4 Cols
                                            $singleColumn = 6;
                                        } else {
                                            if ($singleColumn == 6) {
                                                // 2 Cols
                                                $singleColumn = 12;
                                            }
                                        }
                                    }
                                    $singleTags .= ' double-size';
                                } else {
                                    if ($_tag->name == 'full') {
                                        $singleColumn = 12;
                                        $singleTags .= 'full-size';
                                    } else {
                                        if ($_tag->name == 'half-height') {
                                            $singleTags .= ' half-height';
                                        }
                                    }
                                }
                            }
                        }
//.........这里部分代码省略.........
开发者ID:baochung26,项目名称:happy-c,代码行数:101,代码来源:posts.php


示例16: floatval

}
if ($animation) {
    $attrs['data-animation'] = $animation;
}
if ($animation_delay) {
    $attrs['data-animation-delay'] = floatval($animation_delay);
}
if (is_front_page() || is_home()) {
    $paged = get_query_var('paged') ? get_query_var('paged') : (get_query_var('page') ? get_query_var('page') : 1);
} else {
    $paged = get_query_var('paged') ? get_query_var('paged') : 1;
}
if ($count != '' && !is_numeric($count)) {
    $count = -1;
}
list($query_args, $loop) = vc_build_loop_query($posts_query);
$query_args['paged'] = intval($paged);
$query_args['has_password'] = false;
$query_args['ignore_sticky_posts'] = 1;
$query_args['posts_per_page'] = intval($count);
$blog_posts = new WP_Query($query_args);
$col_class = 'col-md-' . absint(floor(12 / intval($columns)));
?>

<div<?php 
echo wyde_get_attributes($attrs);
?>
>
    <?php 
if ($title || $content) {
    ?>
开发者ID:de190909,项目名称:WPTest,代码行数:31,代码来源:posts_grid.php


示例17: vc_map_get_attributes

<?php

/**
 *	Blog Posts
 *	
 *	Laborator.co
 *	www.laborator.co 
 */
if (function_exists('vc_map_get_attributes')) {
    $atts = vc_map_get_attributes($this->getShortcode(), $atts);
}
extract($atts);
list($query_args, $blog_query) = vc_build_loop_query($blog_query);
$unique_id = 'blogposts-' . mt_rand(1000, 10000);
if (function_exists('uniqid')) {
    $unique_id .= uniqid();
}
$is_masonry = false;
$columns_class = '';
$columns_count = intval($columns);
$more_link = vc_build_link($more_link);
$blog_posts_options = explode(',', $blog_posts_options);
switch ($masonry) {
    case 'masonry':
    case 'packery':
    case 'fitRows':
        $is_masonry = true;
        break;
}
switch ($columns) {
    case '1':
开发者ID:adrienlementheour,项目名称:AliceRouat,代码行数:31,代码来源:lab_blog_posts.php


示例18: array

global $vc_teaser_box;
$posts_query = $el_class = $args = $my_query = $speed = $mode = $swiper_options = '';
$content = $link = $layout = $thumb_size = $link_target = $slides_per_view = $wrap = '';
$autoplay = $hide_pagination_control = $hide_prev_next_buttons = $title = '';
$posts = array();
extract(shortcode_atts(array('el_class' => '', 'posts_query' => '', 'mode' => 'horizontal', 'speed' => '5000', 'slides_per_view' => '1', 'swiper_options' => '', 'wrap' => '', 'autoplay' => 'no', 'hide_pagination_control' => '', 'hide_prev_next_buttons' => '', 'layout' => 'title,thumbnail,excerpt', 'link_target' => '', 'thumb_size' => 'thumbnail', 'partial_view' => '', 'title' => ''), $atts));
global $vc_posts_grid_exclude_id;
$vc_posts_grid_exclude_id[] = get_the_ID();
// fix recursive nesting
if (is_array($posts_query)) {
    $posts_query['post_status'] = 'publish';
} else {
    $posts_query .= '|post_status:publish';
}
list($args, $my_query) = vc_build_loop_query($posts_query, get_the_ID());
$teaser_blocks = vc_sorted_list_parse_value($layout);
/** @var $my_query WP_Query */
while ($my_query->have_posts()) {
    $my_query->the_post();
    // Get post from query
    if (in_array(get_the_ID(), $vc_posts_grid_exclude_id)) {
        continue;
    }
    $post = new stdClass();
    // Creating post object.
    $post->id = get_the_ID();
    $post->link = get_permalink($post->id);
    $post->post_type = get_post_type();
    if ($vc_teaser_box->getTeaserData('enable', $post->id) === '1') {
        $post->custom_user_teaser = true;
开发者ID:chicosilva,项目名称:olharambiental,代码行数:30,代码来源:vc_carousel.php


示例19: foreach

# Rebuild query params for Masonry Portfolio
if (isset($lab_masonry_portfolio) && $lab_masonry_portfolio == true) {
    $portfolio_query = 'size:-1|order_by:post__in|post_type:portfolio|by_id:0';
    foreach ($lab_vc_portfolio_items_details as $item) {
        $portfolio_query .= ",{$item['portfolio_id']}";
    }
    // Remove post type ordering
    if (function_exists('CPTOrderPosts')) {
        remove_filter('posts_orderby', 'CPTOrderPosts', 99, 2);
        $cpto_posts_orderby_removed = true;
    }
}
// Retrieve portfolio main details
include locate_template('tpls/portfolio-query.php');
// Portfolio Masonry Query
list($query_args, $tmp_query) = vc_build_loop_query($portfolio_query);
$query_args['meta_key'] = '_thumbnail_id';
$portfolio_query = new WP_Query($query_args);
// Revert back post ordering filter
if (function_exists('CPTOrderPosts') && isset($cpto_posts_orderby_removed) && $cpto_posts_orderby_removed) {
    add_filter('posts_orderby', 'CPTOrderPosts', 99, 2);
    $cpto_posts_orderby_removed = false;
}
$more_link = vc_build_link($more_link);
# Enqueue Scrips
wp_enqueue_script('isotope');
# Portfolio Vars
$columns_count = isset($columns) ? $columns : 'four';
if ($portfolio_type == 'type-2' && $portfolio_spacing != 'inherit') {
    $portfolio_type_2_grid_spacing = $portfolio_spacing == 'yes' ? 'normal' : 'merged';
}
开发者ID:adrienlementheour,项目名称:AliceRouat,代码行数:31,代码来源:lab_portfolio_items.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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