function axiom_show_post_layout($opt = array(), $post_data = null, $post_obj = null) { $opt = axiom_get_post_data_options($opt); if ($post_data === null) { $post_data = axiom_get_post_data($opt, $post_obj); } // Collect standard output $layout = ''; $func_name = axiom_get_template_function_name($opt['layout']); if (function_exists($func_name)) { if (!$opt['show']) { ob_start(); } $func_name($opt, $post_data); if (!$opt['show']) { $layout = ob_get_contents(); ob_end_clean(); } axiom_sc_clear_dedicated_content(); } return $layout; }
function sc_events($atts, $content = null) { if (axiom_sc_in_shortcode_blogger()) { return ''; } extract(shortcode_atts(array("id" => "", "class" => "", "ids" => "", "cat" => "", "count" => "3", "order" => "desc", "animation" => "", "top" => "", "bottom" => "", "left" => "", "right" => "", "col" => "3", "style" => 'classic'), $atts)); $columns = $col; $css = axiom_get_css_position_from_values($top, $right, $bottom, $left); $AXIOM_sc_events_counter = 0; if (empty($id)) { $id = "sc_events_" . str_replace('.', '', mt_rand()); } if (!empty($ids)) { $posts = explode(',', str_replace(' ', '', $ids)); $count = count($posts); } $output = '<div' . ($id ? ' id="' . esc_attr($id) . '"' : '') . ' class="sc_events masonryWrap' . (!empty($class) ? ' ' . esc_attr($class) : '') . '"' . (!axiom_sc_param_is_off($animation) ? ' data-animation="' . esc_attr(axiom_sc_get_animation_classes($animation)) . '"' : '') . ($css != '' ? ' style="' . esc_attr($css) . '"' : '') . '>'; if ($columns < 1) { $columns = 3; } $output .= '<div class="isotope_wrap" data-columns="' . max(1, min(4, $columns)) . '">'; $args = array('post_type' => 'tribe_events', 'orderby' => 'date', 'order' => $order == 'asc' ? 'asc' : 'desc', 'post_status' => 'publish', 'post_password' => '', 'posts_per_page' => esc_attr((int) max(1, min(4, $count))), 'eventDisplay' => 'custom'); if (!empty($cat)) { if ((int) $cat > 0) { $args['tax_query'] = array(array('taxonomy' => 'tribe_events_cat', 'field' => 'id', 'terms' => $cat)); } else { $args['tax_query'] = array(array('taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => $cat)); } } $query = new WP_Query($args); while ($query->have_posts()) { $query->the_post(); $AXIOM_sc_events_counter++; $args = array('layout' => 'event_classic', 'show' => false, 'number' => $AXIOM_sc_events_counter, 'add_view_more' => false, 'posts_on_page' => $count > 0 ? $count : 1, "posts_visible" => $count, 'thumb_size' => 'events', 'thumb_crop' => true, 'strip_teaser' => false, 'columns_count' => esc_attr((int) $col), 'template_style' => esc_attr($style)); $post_data = axiom_get_post_data($args); //print_r($post_data); $output .= axiom_show_post_layout($args, $post_data); //print_r($output); } wp_reset_postdata(); // Close isotope wrapper $output .= '</div></div>'; return $output; }
} ?> <div class="isotope_wrap <?php echo esc_attr(axiom_get_template_property($blog_style, 'container_classes')); ?> " data-columns="<?php echo esc_attr($blog_columns); ?> "> <?php } while (have_posts()) { the_post(); $post_number++; $post_args = array('layout' => $blog_style, 'number' => $post_number, 'add_view_more' => false, 'posts_on_page' => $per_page, 'columns_count' => $blog_columns, 'strip_teaser' => false, 'content' => axiom_get_template_property($blog_style, 'need_content'), 'terms_list' => !axiom_sc_param_is_off($show_filters) || axiom_get_template_property($blog_style, 'need_terms'), 'parent_tax_id' => $parent_tax_id, 'descr' => axiom_get_custom_option('post_excerpt_maxlength' . ($blog_columns > 1 ? '_masonry' : '')), 'sidebar' => !axiom_sc_param_is_off($show_sidebar), 'filters' => $show_filters != 'hide' ? $show_filters : '', 'hover' => $hover, 'hover_dir' => $hover_dir); $post_data = axiom_get_post_data($post_args); axiom_show_post_layout($post_args, $post_data); if ($show_filters == 'tags') { // Use tags as filter items if (!empty($post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms)) { foreach ($post_data['post_terms'][$post_data['post_taxonomy_tags']]->terms as $tag) { $flt_ids[$tag->term_id] = $tag->name; } } } } if (axiom_get_template_property($blog_style, 'need_isotope')) { ?> </div> <!-- /.isotope_wrap --> <?php }