function rt_staff($atts, $content = null) { /** * Staff Posts * @param array $atts * @param string $content * @return output */ global $rt_item_width, $wp_query; //counter $counter = 1; //defaults extract(shortcode_atts(array("id" => 'staff-' . rand(100000, 1000000), "class" => "", "list_layout" => "1/1", "list_orderby" => "date", "list_order" => "DESC", "ids" => array()), $atts)); //product id numbders $ids = !empty($ids) ? explode(",", trim($ids)) : array(); //item width percentage $list_layout = !empty($list_layout) ? $list_layout : "1/3"; $rt_item_width = $list_layout; //item width number $item_width_number = str_replace("1/", "", $list_layout); //row count $column_count = rt_column_count($list_layout); //general query $args = array('post_status' => 'publish', 'post_type' => 'staff', 'orderby' => $list_orderby, 'order' => $list_order, 'showposts' => 1000); if (!empty($ids)) { $args = array_merge($args, array('post__in' => $ids)); } ob_start(); $theQuery = query_posts($args); //column class $add_column_class = rt_column_class($list_layout); //get page & post counts $page_count = rt_get_page_count(); $post_count = $page_count['post_count']; echo '<section id="' . $id . '" class="team border_grid clearfix ' . $class . ' ">'; while (have_posts()) { the_post(); //open row block if ($counter % $column_count == 1 || $column_count == 1) { echo '<div class="row clearfix">'; } printf('<div class="col %s">' . "\n", $add_column_class); get_template_part('staff-contents/loop', 'content'); echo '</div>' . "\n"; //close row block if ($counter % $column_count == 0 || $post_count == $counter) { echo '</div>'; } $counter++; } echo '</section>'; //rt_get_pagination( $wp_query ); wp_reset_query(); $output_string = ob_get_contents(); ob_end_clean(); return $output_string; }
/** * Product Categories * @param array $atts * @param string $content * @return output */ function rt_product_categories_shortcode($atts = array(), $content = null) { global $rt_list_atts, $rt_category; //defaults $rt_list_atts = shortcode_atts(array("id" => '', "class" => '', "ids" => '', "list_layout" => "1/3", "display_titles" => "true", "display_descriptions" => "true", "display_thumbnails" => "true", "image_max_height" => '', "crop" => '', 'orderby' => 'name', "order" => "ACS", 'parent' => 0, 'layout_style' => ''), $atts); extract($rt_list_atts); ob_start(); // Product Categories $product_args = array('type' => 'post', 'orderby' => $orderby, 'order' => $order, 'hide_empty' => 0, 'hierarchical' => 1, 'taxonomy' => 'product_categories', 'pad_counts' => true, 'include' => $ids, 'parent' => empty($parent) ? 0 : $parent); $product_categories = get_categories($product_args); //fix true false $rt_list_atts["display_titles"] = !empty($display_titles) && $display_titles !== "false" ? "true" : "false"; $rt_list_atts["display_descriptions"] = !empty($display_descriptions) && $display_descriptions !== "false" ? "true" : "false"; $rt_list_atts["display_thumbnails"] = !empty($display_thumbnails) && $display_thumbnails !== "false" ? "true" : "false"; $rt_list_atts["crop"] = !empty($crop) && $crop !== "false" ? "true" : $crop; //id attr $id = !empty($id) ? 'id="' . sanitize_html_class($id) . '"' : ""; //item width percentage $list_layout = !empty($list_layout) ? $list_layout : "1/3"; //column count $column_count = rt_column_count($list_layout); //category count $post_count = count($product_categories); //layout style $add_holder_class = $list_layout == "1/1" ? "" : ($layout_style == "grid" ? " border_grid fixed_heights" : " masonry"); $add_holder_class .= " " . sanitize_html_class($class); //column class $add_column_class = "product_item_holder "; $add_column_class .= rt_column_class($list_layout); $add_column_class .= $layout_style == "masonry" ? " isotope-item" : ""; //open the wrapper echo "\n" . '<div ' . $id . ' class="product_holder product-showcase product-showcase-categories clearfix ' . trim($add_holder_class) . '" data-column-width="' . $column_count . '" >' . "\n"; $counter = 1; foreach ($product_categories as $key => $category) { $rt_category = $category; //open row block if ($layout_style != "masonry" && $list_layout != "1/1" && ($counter % $column_count == 1 || $column_count == 1)) { echo '<div class="row clearfix">' . "\n"; } echo $list_layout != "1/1" ? '<div class="col ' . $add_column_class . '">' . "\n" : ""; get_template_part('product-contents/category-shortcode-content'); echo $list_layout != "1/1" ? '</div>' . "\n" : ""; //close row block if ($layout_style != "masonry" && $list_layout != "1/1" && ($counter % $column_count == 0 || $post_count == $counter)) { echo '</div>' . "\n"; } $counter++; } echo '</div>'; $output_string = ob_get_contents(); ob_end_clean(); return $output_string; }
/** * Image Gallery - Single Image Shortcode * * @param array $atts * @param string $content * @return html */ function rt_gal_item($atts, $content = null) { global $rt_image_gallery_globals, $rt_global_variables; //defaults extract(shortcode_atts(array("id" => '', "class" => '', "image_id" => '', "image_url" => '', "custom_link" => '', "title" => '', "action" => 'lightbox', "link_target" => '_self'), $atts)); //variables $output = $caption_output = $lightbox_link = $image_effect = ""; // Thumbnail width & height $w = rt_get_min_resize_size($rt_image_gallery_globals["list_layout"]); $h = $rt_image_gallery_globals["crop"] == "true" ? $w : 10000; // Get image data $image_args = array("image_url" => $image_url, "image_id" => $image_id, "w" => $w, "h" => $h, "crop" => $rt_image_gallery_globals["crop"]); $image_output = rt_get_image_data($image_args); //tooltip $tooltip = $rt_image_gallery_globals["tooltips"] == "true" ? ' data-placement="top" data-toggle="tooltip" data-original-title="' . $title . '"' : ""; //create lightbox link if ($action == "lightbox") { $image = rt_create_lightbox_link(array('class' => 'zoom lightbox_ imgeffect', 'href' => $image_output["image_url"], 'title' => $title, 'data_group' => $rt_image_gallery_globals["gallery_id"], 'data_title' => $title, 'data_description' => "", 'tooltip' => $rt_image_gallery_globals["tooltips"], 'data_thumbnail' => $image_output["lightbox_thumbnail"], 'inner_content' => '<img src="' . $image_output["thumbnail_url"] . '" alt="' . $title . '" class="img-responsive">', 'echo' => false)); } elseif ($action == "custom_link") { $image = sprintf(' <a href="%1$s" title="%2$s" target="%3$s" class="link icon imgeffect"> <img src="%4$s" class="img-responsive" alt="%2$s"%5$s> </a>', $custom_link, $title, $link_target, $image_output["thumbnail_url"], $tooltip); } else { $image = sprintf('<img src="%s" class="img-responsive" alt="%s"%s> ', $image_output["thumbnail_url"], $title, $tooltip); } //create caption $caption_output = !empty($content) ? '<div class="caption">' . rt_visual_composer_content_fix($content, "true") . '</div>' : ""; //open holder if ($rt_image_gallery_globals["counter"] % $rt_image_gallery_globals["column_count"] == 1 || $rt_image_gallery_globals["column_count"] == 1) { $output .= '<div class="row fixed_heights">'; } //id attr $id_attr = !empty($id) ? 'id="' . $id . '"' : ""; //list items output $output .= sprintf(' <div %1$s class="col %3$s col-xs-12 %2$s"> %4$s %5$s </div> ', $id_attr, $class, rt_column_class($rt_image_gallery_globals["list_layout"]), $image, $caption_output); //close holder if ($rt_image_gallery_globals["counter"] % $rt_image_gallery_globals["column_count"] == 0 || $rt_image_gallery_globals["item_count"] == $rt_image_gallery_globals["counter"]) { $output .= '</div>'; } //increase counter $rt_image_gallery_globals["counter"]++; return $output; }
/** * rt_column shortcode * * creates a holder for contents with several background effects and layouts * * @param [array] $atts * @param [string] $content */ function rt_column($atts, $content = null) { extract(shortcode_atts(array('width' => '1/1', 'id' => '', 'class' => '', 'rt_font_color' => '', 'rt_bg_color' => '', 'rt_bg_image' => '', 'rt_bg_effect' => '', 'rt_bg_image_repeat' => '', 'rt_bg_size' => '', 'rt_bg_attachment' => '', 'rt_padding_top' => '', 'rt_padding_bottom' => '', 'rt_padding_left' => '', 'rt_padding_right' => '', 'rt_color_set' => '', 'vc_base' => ''), $atts)); $style = $output = ""; //id attr $id = !empty($id) ? 'id="' . sanitize_html_class($id) . '"' : ""; //row style $class .= !empty($rt_color_set) ? " " . $rt_color_set : ""; //column width if (empty($vc_base)) { $class .= " col col-xs-12 " . rt_column_class($width) . ""; } //column paddings $style .= $rt_padding_top != "" ? 'padding-top:' . str_replace("px", "", $rt_padding_top) . 'px;' : ""; $style .= $rt_padding_bottom != "" ? 'padding-bottom:' . str_replace("px", "", $rt_padding_bottom) . 'px;' : ""; $style .= $rt_padding_left != "" ? 'padding-left:' . str_replace("px", "", $rt_padding_left) . 'px;' : ""; $style .= $rt_padding_right != "" ? 'padding-right:' . str_replace("px", "", $rt_padding_right) . 'px;' : ""; //background settings if (!empty($rt_bg_image)) { $bg_image_url = wp_get_attachment_image_src($rt_bg_image, "full"); $bg_image_url = is_array($bg_image_url) ? $bg_image_url[0] : ""; //background image $style .= !empty($bg_image_url) ? 'background-image: url(' . $bg_image_url . ');' : ""; //background repeat $style .= !empty($rt_bg_image_repeat) ? 'background-repeat: ' . $rt_bg_image_repeat . ';' : ""; //background size $style .= !empty($rt_bg_size) ? 'background-size: ' . $rt_bg_size . ';' : ""; //background attachment $style .= !empty($rt_bg_attachment) ? 'background-attachment: ' . $rt_bg_attachment . ';' : ""; } //background color $style .= !empty($rt_bg_color) ? 'background-color: ' . $rt_bg_color . ';' : ""; //font color $style .= !empty($rt_font_color) ? 'color: ' . $rt_font_color . ';' : ""; //create styles $style_output = !empty($style) ? 'style="' . $style . '"' : ""; $output .= "\n\t" . '<div class="' . trim($class) . '" ' . $style_output . '>'; $output .= !empty($vc_base) ? "\n\t\t" . '<div class="wpb_wrapper">' : ""; $output .= "\n\t\t\t" . do_shortcode($content); $output .= !empty($vc_base) ? "\n\t\t" . '</div>' : ""; $output .= "\n\t" . '</div>' . "\n"; return $output; }
/** * Create photo gallery * by using provided image urls as an array * * @param array $atts * @return output */ function rt_create_photo_gallery($atts) { //defaults extract(shortcode_atts(array("gallery_id" => 'gallery-' . rand(100000, 1000000), "crop" => false, "h" => "", "image_urls" => array(), "image_ids" => array(), "lightbox" => false, "captions" => true, "item_width" => "1/6", "layout_style" => "grid"), $atts)); //item width percentage $item_width = !empty($item_width) ? $item_width : "1/3"; //image array $image_array = !empty($image_urls) ? $image_urls : $image_ids; //create values $items_output = $caption_output = $lightbox_link = $image_effect = ""; // Thumbnail width & height $w = rt_get_min_resize_size($item_width); if (empty($h)) { $h = $crop ? $w / 1.5 : 10000; } //layout style $add_holder_class = $item_width == "1/1" ? "" : ($layout_style == "grid" ? " border_grid fixed_heights" : " masonry"); //add column class $add_column_class = rt_column_class($item_width); $add_column_class .= $layout_style == "masonry" ? " isotope-item" : ""; //row count $column_count = rt_column_count($item_width); //item counter $counter = 1; foreach ($image_array as $image) { // Get image data $image_args = array("image_url" => "", "image_id" => "", "w" => $w, "h" => $h, "crop" => $crop); if (!empty($image_urls)) { $image_args["image_url"] = $image; } else { $image_args["image_id"] = $image; } $image_data = rt_get_image_data($image_args); //create image html output if ($lightbox) { $image_output = rt_create_lightbox_link(array('class' => 'lightbox_ zoom imgeffect', 'href' => $image_data["image_url"], 'title' => __('Enlarge Image', 'rt_theme'), 'data_group' => $gallery_id, 'data_title' => $image_data["image_title"], 'data_description' => $image_data["image_caption"], 'data_thumbnail' => $image_data["lightbox_thumbnail"], 'echo' => false, 'inner_content' => sprintf('<img src="%s" alt="%s">', $image_data["thumbnail_url"], $image_data["image_alternative_text"]))); } else { $image_output = sprintf('<img src="%s" alt="%s">', $image_data["thumbnail_url"], $image_data["image_alternative_text"]); } //create caption $caption_output = $captions && !empty($image_data["image_caption"]) ? sprintf(' <p class="gallery-caption-text">%s</p> ', $image_data["image_caption"]) : ""; //open row block if ($layout_style != "masonry" && $item_width != "1/1" && ($counter % $column_count == 1 || $column_count == 1)) { $items_output .= '<div class="row clearfix">' . "\n"; } //list items output $items_output .= sprintf(' <div class="col %s"> %s %s </div> ', $add_column_class, $image_output, $caption_output); //close row block if ($layout_style != "masonry" && $item_width != "1/1" && ($counter % $column_count == 0 || count($image_array) == $counter)) { $items_output .= '</div>' . "\n"; } $counter++; } //the gallery holder output $gallery_holder_output = sprintf(' <div class="photo_gallery clearfix %s" id="%s" data-column-width="%s">%s</div> ', $add_holder_class, $gallery_id, $column_count, $items_output); echo $gallery_holder_output; }
/** * Product Loop * @param array $wp_query * @param array $atts * @return output */ function rt_product_post_loop($wp_query = array(), $atts = array()) { global $rt_product_post_values, $rt_product_list_atts; //sanitize fields $atts["id"] = isset($atts["id"]) ? sanitize_html_class($atts["id"]) : 'product-dynamicID-' . rand(100000, 1000000); //defaults $rt_product_list_atts = shortcode_atts(array("id" => 'product-dynamicID-' . rand(100000, 1000000), "list_layout" => get_theme_mod(RT_THEMESLUG . '_product_layout'), "layout_style" => get_theme_mod(RT_THEMESLUG . '_product_layout_style'), "pagination" => "true", "ajax_pagination" => "false", "featured_image_resize" => get_theme_mod(RT_THEMESLUG . "_product_image_resize"), "featured_image_max_width" => get_theme_mod(RT_THEMESLUG . "_product_image_width"), "featured_image_max_height" => get_theme_mod(RT_THEMESLUG . "_product_image_height"), "featured_image_crop" => get_theme_mod(RT_THEMESLUG . "_product_image_crop"), "list_orderby" => "date", "list_order" => "DESC", "item_per_page" => 10, "categories" => "", "ajax" => "false", "paged" => 0, "wpml_lang" => "", "display_descriptions" => "true", "display_titles" => "true", "display_price" => get_theme_mod(RT_THEMESLUG . "_show_price_in_list"), "ids" => ""), $atts); extract($rt_product_list_atts); $wp_reset_postdata = false; //counter $counter = 1; //custom query if (!$wp_query) { //paged if ($pagination !== "false" && $paged == 0) { if (get_query_var('paged')) { $paged = get_query_var('paged'); } elseif (get_query_var('page')) { $paged = get_query_var('page'); } else { $paged = 1; } } //create a post status array $post_status = is_user_logged_in() ? array('private', 'publish') : "publish"; //general query $args = array('post_status' => $post_status, 'post_type' => 'products', 'orderby' => $list_orderby, 'order' => $list_order, 'posts_per_page' => $item_per_page, 'paged' => $paged); if (!empty($ids)) { $ids = !empty($ids) ? explode(",", trim($ids)) : array(); $args = array_merge($args, array('post__in' => $ids)); } if (!empty($categories)) { $categories = is_array($categories) ? $categories : explode(",", rt_wpml_lang_object_ids($categories, "product_categories", $wpml_lang)); $args = array_merge($args, array('tax_query' => array(array('taxonomy' => 'product_categories', 'field' => 'id', 'terms' => $categories, 'operator' => "IN")))); } $wp_query = new WP_Query($args); $wp_reset_postdata = true; } //get page & post counts $post_count = $wp_query->post_count; $page_count = $wp_query->max_num_pages; //item width percentage $list_layout = !empty($list_layout) ? $list_layout : "1/3"; //layout style $add_holder_class = $list_layout == "1/1" ? "" : ($layout_style == "grid" ? " border_grid fixed_heights" : " masonry"); //column class $add_column_class = "product_item_holder "; $add_column_class .= rt_column_class($list_layout); $add_column_class .= $layout_style == "masonry" ? " isotope-item" : ""; //column count $column_count = rt_column_count($list_layout); if ($wp_query->have_posts()) { //open the wrapper echo "\n" . '<div id="' . $id . '" class="product_holder product-showcase clearfix ' . $add_holder_class . '" data-column-width="' . $column_count . '" itemscope itemtype="http://schema.org/Product">' . "\n"; //the loop while ($wp_query->have_posts()) { $wp_query->the_post(); //get post values $rt_product_post_values = rt_get_product_loop_post_values($wp_query->post, $rt_product_list_atts); //selected term list of each post $term_list = get_the_terms($wp_query->post->ID, 'product_categories'); //add terms as class name $addTermsClass = ""; if ($term_list) { if (is_array($term_list)) { foreach ($term_list as $termSlug) { $addTermsClass .= " " . $termSlug->slug; } } } //open row block if ($layout_style != "masonry" && $list_layout != "1/1" && ($counter % $column_count == 1 || $column_count == 1)) { echo '<div class="row clearfix">' . "\n"; } echo $list_layout != "1/1" ? '<div class="col ' . $add_column_class . ' ' . $addTermsClass . '">' . "\n" : ""; get_template_part('product-contents/loop', 'content'); echo $list_layout != "1/1" ? '</div>' . "\n" : ""; //close row block if ($layout_style != "masonry" && $list_layout != "1/1" && ($counter % $column_count == 0 || $post_count == $counter)) { echo '</div>' . "\n"; } $counter++; } //close wrapper echo '</div>' . "\n"; if ($pagination !== "false" && $ajax_pagination === "false" || $pagination !== "false" && $layout_style != "masonry") { rt_get_pagination($wp_query); } if ($ajax_pagination !== "false" && $layout_style == "masonry" && $page_count > 1 && $ajax === "false") { $rt_product_list_atts["purpose"] = "products"; rt_get_ajax_loader_button($rt_product_list_atts, $page_count); } } //reset post data for the new query if ($wp_reset_postdata) { wp_reset_postdata(); } }
/** * Woo Products * @param array $wp_query * @param array $atts * @return output */ function rt_woo_products($atts = array()) { //sanitize fields $atts["id"] = isset($atts["id"]) ? sanitize_html_class($atts["id"]) : 'product-dynamicID-' . rand(100000, 1000000); //defaults $rt_product_list_atts = shortcode_atts(array("id" => 'product-dynamicID-' . rand(100000, 1000000), "list_layout" => "1/3", "pagination" => "true", "list_orderby" => "date", "list_order" => "DESC", "item_per_page" => 10, "categories" => "", "paged" => 0, "ids" => ""), $atts); extract($rt_product_list_atts); //counter $counter = 1; //paged if ($pagination && $paged == 0) { if (get_query_var('paged')) { $paged = get_query_var('paged'); } elseif (get_query_var('page')) { $paged = get_query_var('page'); } else { $paged = 1; } } //create a post status array $post_status = is_user_logged_in() ? array('private', 'publish') : "publish"; //general query $args = array('post_status' => $post_status, 'post_type' => 'product', 'orderby' => $list_orderby, 'order' => $list_order, 'posts_per_page' => $item_per_page, 'ignore_sticky_posts' => 1, 'paged' => $paged, 'meta_query' => array(array('key' => '_visibility', 'value' => array('catalog', 'visible'), 'compare' => 'IN'))); if (!empty($ids)) { $ids = !empty($ids) ? explode(",", trim($ids)) : array(); $args = array_merge($args, array('post__in' => $ids)); } if (!empty($categories)) { $categories = is_array($categories) ? $categories : explode(",", rt_wpml_lang_object_ids($categories, "product_cat")); $args = array_merge($args, array('tax_query' => array(array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => $categories, 'operator' => "IN")))); } $wp_query = new WP_Query($args); //get page & post counts $post_count = $wp_query->post_count; $page_count = $wp_query->max_num_pages; //item width percentage $list_layout = !empty($list_layout) ? $list_layout : "1/3"; //layout style $add_holder_class = $list_layout == "1/1" ? "" : " border_grid fixed_heights"; //column class $add_column_class = "product_item_holder "; $add_column_class .= rt_column_class($list_layout); //column count $column_count = rt_column_count($list_layout); //output $output = ""; if ($wp_query->have_posts()) { //open the wrapper $output .= "\n" . '<div id="' . $id . '" class="woocommerce product_holder product-showcase clearfix ' . $add_holder_class . '" data-column-width="' . $column_count . '" itemscope itemtype="http://schema.org/Product">' . "\n"; //the loop while ($wp_query->have_posts()) { $wp_query->the_post(); //open row block if ($list_layout != "1/1" && ($counter % $column_count == 1 || $column_count == 1)) { $output .= '<div class="row clearfix">' . "\n"; } $output .= $list_layout != "1/1" ? '<div class="col ' . $add_column_class . '">' . "\n" : ""; ob_start(); get_template_part('woocommerce/shortcode-content', 'product'); $output .= ob_get_contents(); ob_end_clean(); $output .= $list_layout != "1/1" ? '</div>' . "\n" : ""; //close row block if ($list_layout != "1/1" && ($counter % $column_count == 0 || $post_count == $counter)) { $output .= '</div>' . "\n"; } $counter++; } //reset post data for the new query wp_reset_postdata(); //close wrapper $output .= '</div>' . "\n"; if ($pagination !== "false") { $output .= rt_get_pagination($wp_query, 8, false, false, false); } return $output; } }
/** * Testimonanials * @param array $atts * @param string $content * @return output */ function rt_testimonials($atts, $content = null) { global $client_images; //counter $counter = 1; //defaults extract(shortcode_atts(array("id" => 'testimonial-' . rand(100000, 1000000), "class" => '', "list_layout" => "1/1", "ids" => array(), "item_per_page" => 9, "list_orderby" => "date", "list_order" => "DESC", "pagination" => "false", "style" => "left", "client_images" => "true", "categories" => ""), $atts)); //product id numbders $ids = !empty($ids) ? explode(",", trim($ids)) : array(); //item width percentage $list_layout = !empty($list_layout) ? $list_layout : "1/3"; //row count $column_count = rt_column_count($list_layout); //paged if ($pagination !== "false") { if (get_query_var('paged')) { $paged = get_query_var('paged'); } elseif (get_query_var('page')) { $paged = get_query_var('page'); } else { $paged = 1; } } else { $paged = 0; } //create a post status array $post_status = is_user_logged_in() ? array('private', 'publish') : "publish"; //general query $args = array('post_status' => $post_status, 'post_type' => 'testimonial', 'orderby' => $list_orderby, 'order' => $list_order, 'posts_per_page' => $item_per_page, 'paged' => $paged); if (!empty($ids)) { $args = array_merge($args, array('post__in' => $ids)); } if (!empty($categories)) { $categories = is_array($categories) ? $categories : explode(",", rt_wpml_lang_object_ids($categories, "testimonial_categories")); $args = array_merge($args, array('tax_query' => array(array('taxonomy' => 'testimonial_categories', 'field' => 'id', 'terms' => $categories, 'operator' => "IN")))); } ob_start(); $theQuery = new WP_Query($args); //get page & post counts $post_count = $theQuery->post_count; //add additional classes $class .= " " . $style; //column class $add_column_class = rt_column_class($list_layout); //id attr $id_attr = !empty($id) ? 'id="' . sanitize_html_class($id) . '"' : ""; echo '<section ' . $id_attr . ' class="border_grid testimonials clearfix ' . $class . ' " data-column-width="' . $column_count . '">'; while ($theQuery->have_posts()) { $theQuery->the_post(); //add first last classes if filterable is off $add_class = ""; if ($counter % $column_count == 1 || $column_count == 1) { $add_class .= " first"; } if (($counter % $column_count == 0 || $post_count == $counter) && $add_class == "") { $add_class .= " last"; } //post class $add_class .= " " . implode(get_post_class("loop"), " "); //open row block if ($counter % $column_count == 1 || $column_count == 1) { echo '<div class="row">'; } printf('<div id="%s" class="testimonial col %s %s">' . "\n", get_the_ID(), $add_column_class, $add_class); get_template_part('testimonial-contents/content'); echo '</div>' . "\n"; //close row block and add hr if ($counter % $column_count == 0 || $post_count == $counter) { echo '</div>'; } $counter++; } echo '</section>'; if ($pagination !== "false") { rt_get_pagination($theQuery); } wp_reset_postdata(); $output_string = ob_get_contents(); ob_end_clean(); return $output_string; }