<div id="main-content" class="mh-loop mh-content"><?php mh_before_page_content(); if (category_description()) { ?> <section class="cat-desc"> <?php echo category_description(); ?> </section><?php } if (have_posts()) { while (have_posts()) { the_post(); get_template_part('content', 'loop-' . $options['loop_layout']); } mh_pagination(); } else { get_template_part('content', 'none'); } ?> </div> <?php get_sidebar(); ?> </div> <?php mh_second_sb(); ?> </div> <?php get_footer();
function mh_loop() { if (have_posts()) { while (have_posts()) { the_post(); get_template_part('loop', get_post_format()); } mh_pagination(); } else { get_template_part('content', 'none'); } }
function mh_loop() { global $post, $paged, $options; $do_not_duplicate[] = ''; $counter = 0; $layout = isset($options['loop_layout']) ? $options['loop_layout'] : 'layout1'; $adcode = empty($options['loop_ad']) ? '' : '<div class="loop-ad loop-ad-' . $layout . '">' . do_shortcode($options['loop_ad']) . '</div>' . "\n"; $adcount = empty($options['loop_ad_no']) ? '3' : $options['loop_ad_no']; if (is_category() && $paged < 2 && isset($options['loop_slider']) && $options['loop_slider'] != 'no_slider') { $category = single_cat_title("", false); $cat_id = get_cat_ID($category); $cat_meta = get_option("category_{$cat_id}"); $cat_postcount = isset($cat_meta['slider_postcount']) ? $cat_meta['slider_postcount'] : '5'; $cat_posts = new WP_Query('showposts=' . intval($cat_postcount) . '&cat=' . $cat_id); if ($cat_posts->have_posts()) { get_template_part('/templates/loop-slider', get_post_format()); while ($cat_posts->have_posts()) { $cat_posts->the_post(); $do_not_duplicate[] = $post->ID; } } } if (have_posts()) { echo '<div class="loop-content clearfix">' . "\n"; while (have_posts()) { the_post(); if (in_array($post->ID, $do_not_duplicate)) { continue; } get_template_part('/templates/loop-' . $layout, get_post_format()); if ($counter % $adcount == 0) { echo $adcode; } $counter++; } echo '</div>' . "\n"; mh_pagination(); } else { get_template_part('content', 'none'); } }
function mh_loop() { global $options; $counter = 0; $layout = isset($options['loop_layout']) ? $options['loop_layout'] : 'layout1'; $adcode = empty($options['loop_ad']) ? '' : '<div class="loop-ad loop-ad-' . $layout . '">' . do_shortcode($options['loop_ad']) . '</div>' . "\n"; $adcount = empty($options['loop_ad_no']) ? '3' : $options['loop_ad_no']; if (have_posts()) { while (have_posts()) { the_post(); get_template_part('/templates/loop-' . $layout, get_post_format()); if ($counter % $adcount == 0) { echo $adcode; } $counter++; } mh_pagination(); } else { get_template_part('content', 'none'); } }