Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ppb_tour_grid_func_razztech($atts, $content) {
- //extract short code attr
- extract(shortcode_atts(array(
- 'size' => 'one',
- 'title' => '',
- 'items' => 30,
- 'tourcat' => '',
- 'order' => 'default',
- 'custom_css' => '',
- 'layout' => 'fullwidth',
- ), $atts));
- if(!is_numeric($items))
- {
- $items = 30;
- }
- $return_html = '<div class="ppb_tour '.$size.' withpadding ';
- $columns_class = 'three_cols';
- if($layout=='fullwidth')
- {
- $columns_class.= ' fullwidth';
- }
- $element_class = 'one_third gallery3';
- $tour_h = 'h5';
- if(empty($content) && empty($title))
- {
- $return_html.='nopadding ';
- }
- $return_html.= '" ';
- if(!empty($custom_css))
- {
- $return_html.= 'style="'.urldecode($custom_css).'" ';
- }
- $return_html.= '>';
- $return_html.='<div class="page_content_wrapper ';
- if($layout == 'fullwidth')
- {
- $return_html.='full_width';
- }
- $return_html.= '" style="text-align:center">';
- //Display Title
- if(!empty($title))
- {
- $return_html.= '<h2 class="ppb_title">'.$title.'</h2>';
- }
- //Display Content
- if(!empty($content) && !empty($title))
- {
- $return_html.= '<div class="page_caption_desc">'.$content.'</div>';
- }
- //Display Horizontal Line
- if(empty($content) && !empty($title))
- {
- $return_html.= '<br/>';
- }
- $tour_order = 'ASC';
- $tour_order_by = 'menu_order';
- switch($order)
- {
- case 'default':
- $tour_order = 'ASC';
- $tour_order_by = 'menu_order';
- break;
- case 'newest':
- $tour_order = 'DESC';
- $tour_order_by = 'post_date';
- break;
- case 'oldest':
- $tour_order = 'ASC';
- $tour_order_by = 'post_date';
- break;
- case 'title':
- $tour_order = 'ASC';
- $tour_order_by = 'title';
- break;
- case 'random':
- $tour_order = 'ASC';
- $tour_order_by = 'rand';
- break;
- }
- //Get tour items
- $args = array(
- 'numberposts' => $items,
- 'order' => $tour_order,
- 'orderby' => $tour_order_by,
- 'post_type' => array('tours'),
- 'tax_query' => array(
- array(
- 'taxonomy' => 'tourcats',
- 'exclude' => '34,35,36',
- 'include_children' => false
- )
- ),
- 'suppress_filters' => 0,
- );
- if(!empty($tourcat))
- {
- $args['tourcats'] = $tourcat;
- }
- $tours_arr = get_posts($args);
- /********************/
- ?>
- <div class="portfolio_filter_wrapper three_cols fullwidth shortcode gallery section content clearfix">
- <?php
- foreach(get_terms('tourcats') as $cat)
- {
- //Begin display HTML
- ?>
- <div class="element portfolio3filter_wrapper">
- <div class="<?php echo $element_class; ?> filterable gallery_type animated1">
- <a href='<?php echo get_term_link($cat->slug, 'tourcats'); ?>'>
- <img src="<?php echo z_taxonomy_image_url($cat->term_id,'gallery_grid'); ?> " alt="" />
- </a>
- <div class="thumb_content fullwidth">
- <div class="thumb_title" style="width: 100%;">
- <h3><?php echo $cat->name; ?></h3>
- </div>
- </div>
- </div>
- </div>
- <?php } ?>
- </div>
- </div>
- </div>
- <?php
- return $return_html;
- }
- add_shortcode('ppb_tour_grid_razztech', 'ppb_tour_grid_func_razztech');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement