/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { ob_start(); //start buffering the output instead of echoing it comments_template(); //wordpress function that loads the comments template "comments.php" $output = ob_get_clean(); $class = ""; if (function_exists('avia_blog_class_string')) { $class = avia_blog_class_string(); } $output = "<div class='av-buildercomment {$class}'>{$output}</div>"; return $output; }
echo avia_title(array('heading' => 'strong', 'title' => $title, 'link' => $t_link, 'subtitle' => $t_sub)); } ?> <div class='container_wrap container_wrap_first main_color <?php avia_layout_class('main'); ?> '> <div class='container template-blog template-single-blog '> <main class='content units <?php avia_layout_class('content'); ?> <?php echo avia_blog_class_string(); ?> ' <?php avia_markup_helper(array('context' => 'content', 'post_type' => 'post')); ?> > <?php /* Run the loop to output the posts. * If you want to overload this in a child theme then include a file * called loop-index.php and that will be used instead. * */ get_template_part('includes/loop', 'index'); //show related posts based on tags if there are any get_template_part('includes/related-posts');
/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { global $avia_config, $more; if (empty($atts['categories'])) { $atts['categories'] = ""; } if (isset($atts['link']) && isset($atts['blog_type']) && $atts['blog_type'] == 'taxonomy') { $atts['link'] = explode(',', $atts['link'], 2); $atts['taxonomy'] = $atts['link'][0]; if (!empty($atts['link'][1])) { $atts['categories'] = $atts['link'][1]; } else { if (!empty($atts['taxonomy'])) { $taxonomy_terms_obj = get_terms($atts['taxonomy']); foreach ($taxonomy_terms_obj as $taxonomy_term) { $atts['categories'] .= $taxonomy_term->term_id . ','; } } } } $atts = shortcode_atts(array('blog_style' => '', 'columns' => 3, 'blog_type' => 'posts', 'items' => '16', 'paginate' => 'yes', 'categories' => '', 'preview_mode' => 'auto', 'image_size' => 'portfolio', 'taxonomy' => 'category', 'post_type' => get_post_types(), 'contents' => 'excerpt', 'content_length' => 'content', 'offset' => '0', 'conditional' => ''), $atts, $this->config['shortcode']); $page = get_query_var('paged') ? get_query_var('paged') : get_query_var('page'); if (!$page) { $page = 1; } if ($atts['blog_style'] == "blog-grid") { $atts['class'] = $meta['el_class']; $atts['type'] = 'grid'; //using the post slider with inactive js will result in displaying a nice post grid $slider = new avia_post_slider($atts); $slider->query_entries(); if ($atts['conditional'] && $page != 1) { return; } else { return $slider->html(); } } $this->query_entries($atts); $avia_config['blog_style'] = $atts['blog_style']; $avia_config['preview_mode'] = $atts['preview_mode']; $avia_config['image_size'] = $atts['image_size']; $avia_config['blog_content'] = $atts['content_length']; $avia_config['remove_pagination'] = $atts['paginate'] === "yes" ? false : true; $more = 0; ob_start(); //start buffering the output instead of echoing it get_template_part('includes/loop', 'index'); $output = ob_get_clean(); wp_reset_query(); avia_set_layout_array(); if ($output) { $extraclass = function_exists('avia_blog_class_string') ? avia_blog_class_string() : ""; $markup = avia_markup_helper(array('context' => 'blog', 'echo' => false, 'custom_markup' => $meta['custom_markup'])); $output = "<div class='template-blog {$extraclass}' {$markup}>{$output}</div>"; } if ($atts['conditional'] && $page != 1) { return; } else { return $output; } }