function rt_default_content($atts, $content = null) { //[default_content] global $rt_post_type, $rt_global_post_values, $post; ob_start(); wp_reset_query(); // content of single product page if ($rt_post_type == "products") { get_template_part('/product-contents/single', 'products-content'); } elseif ($rt_post_type == "portfolio") { get_template_part('/portfolio-contents/single', 'portfolio-content'); } elseif ($rt_post_type == "product" && is_archive()) { get_template_part('/woocommerce/templatebuilder/archive', 'product'); } elseif ($rt_post_type == "product" && is_single()) { get_template_part('/woocommerce/templatebuilder/single', 'product'); } elseif ($rt_post_type == "staff" && is_single()) { get_template_part('/staff-contents/single', 'staff-content'); } elseif ($rt_post_type == "post") { //get global post values $rt_global_post_values = rt_get_global_post_values($post); get_template_part('/post-contents/single-content', get_post_format()); //get comments if (comments_open()) { echo '<div class="entry commententry">'; comments_template(); echo '</div>'; } } else { get_template_part('content', 'page'); } $output_string = ob_get_contents(); ob_end_clean(); return $output_string; }
function rt_blog_post_loop($wp_query = false, $list_layout = "one", $archive = false) { global $more, $rt_list_style, $rt_global_post_values, $rt_pagination; //counter $counter = 1; //get the list style of the post $rt_list_style = isset($rt_list_style) ? $rt_list_style : get_option(RT_THEMESLUG . '_blog_list_style'); //layout name values $layout_values = array('one' => 1, 'two' => 2, 'three' => 3, 'four' => 4, 'five' => 5); //item width $item_width = $layout_values[$list_layout]; //add_class $add_class = $item_width > 1 ? "small_box" : ""; if ($wp_query->have_posts()) { while ($wp_query->have_posts()) { $wp_query->the_post(); //get global post values $rt_global_post_values = rt_get_global_post_values($wp_query->post, $item_width); //more splitter 0 = split content with more tag, 1 = ignore more tag $more = 0; if ($counter % $layout_values[$list_layout] == 1 || $layout_values[$list_layout] == 1) { echo '<div class="row">'; } printf('<div class="box %s %s" data-rt-animate="animate" data-rt-animation-type="fadeIn" data-rt-animation-group="single">' . "\n", $list_layout, $add_class); add_filter("the_content", "remove_blog_shortcode", 10); if ($archive) { get_template_part('/post-contents/archive', 'content'); } else { get_template_part('/post-contents/content', get_post_format()); } echo '</div>' . "\n"; if ($counter % $layout_values[$list_layout] == 0 || $wp_query->post_count == $counter) { echo '</div>'; } $counter++; } if ($rt_pagination) { rt_get_pagination($wp_query); } } }
<div class="row"> <?php do_action("get_info_bar", apply_filters('get_info_bar_posts', array("called_for" => "inside_content"))); ?> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <?php //get global post values $rt_global_post_values = rt_get_global_post_values($post); get_template_part('/post-contents/single-content', get_post_format()); ?> <?php } } else { ?> <?php get_template_part('content', 'none'); ?> <?php } ?>