function weaverx_archive_loop($type) { // output loop for archive-like pages. $num_cols = weaverx_getopt('blog_cols'); $archive_cols = weaverx_getopt('archive_cols'); if (!$num_cols || $num_cols > 3) { $num_cols = 1; } if (!$archive_cols) { $num_cols = 1; } $masonry_wrap = false; // need this for one-column posts $col = 0; weaverx_post_count_clear(); echo "<div class=\"wvrx-posts\">\n"; // needed here, and all post loops to make content-n-col work with :nth-of-type while (have_posts()) { the_post(); weaverx_post_count_bump(); if ($archive_cols && !$masonry_wrap) { $masonry_wrap = true; if (weaverx_masonry('begin-posts')) { // wrap all posts $num_cols = 1; } // force to 1 cols } weaverx_masonry('begin-post'); // wrap each post switch ($num_cols) { case 1: get_template_part('templates/content', get_post_format()); break; case 2: $col++; echo '<div class="content-2-col">' . "\n"; get_template_part('templates/content', get_post_format()); echo "</div> <!-- content-2-col -->\n"; break; case 3: $col++; echo '<div class="content-3-col">' . "\n"; get_template_part('templates/content', get_post_format()); echo "</div> <!-- content-3-col -->\n"; break; default: get_template_part('templates/content', get_post_format()); } // end switch num cols weaverx_masonry('end-post'); } // end while have posts weaverx_masonry('end-posts'); echo "</div>\n"; }
<?php if (!defined('ABSPATH')) { exit; } // Exit if accessed directly /** * Template Name: Blank * */ /*! ** DO NOT EDIT THIS FILE! It will be overwritten when the theme is updated! ** */ $sb_layout = weaverx_page_lead('page-blank'); // and next the content area. weaverx_sb_precontent('page-blank'); // generate page content while (have_posts()) { weaverx_post_count_clear(); the_post(); get_template_part('templates/content', 'blank'); comments_template('', true); } weaverx_sb_postcontent('page-blank'); weaverx_page_tail('page-blank', $sb_layout); // end of page wrap
function weaverx_render_infinite_scroll() { $GLOBALS['weaverx_page_who'] = 'blog'; $num_cols = weaverx_getopt('blog_cols'); if (!$num_cols || $num_cols > 3) { $num_cols = 1; } $col = 0; $masonry_wrap = false; // need this for one-column posts /* Start the Loop */ weaverx_post_count_clear(); echo "<div class=\"wvrx-posts\">\n"; while (have_posts()) { the_post(); weaverx_post_count_bump(); if (!$masonry_wrap) { $masonry_wrap = true; if (weaverx_masonry('begin-posts')) { // wrap all posts $num_cols = 1; } // force to 1 cols } weaverx_masonry('begin-post'); // wrap each post switch ($num_cols) { case 1: get_template_part('templates/content', get_post_format()); $sticky_one = false; break; case 2: $col++; echo '<div class="content-2-col clearfix">' . "\n"; get_template_part('templates/content', get_post_format()); echo "</div> <!-- content-2-col -->\n"; $sticky_one = false; break; case 3: $col++; echo '<div class="content-3-col clearfix">' . "\n"; get_template_part('templates/content', get_post_format()); echo "</div> <!-- content-3-col -->\n"; $sticky_one = false; break; default: get_template_part('templates/content', get_post_format()); $sticky_one = false; } // end switch num cols weaverx_masonry('end-post'); } // end while have posts weaverx_masonry('end-posts'); echo "</div>\n"; }