/** * Build post slider array. * * Get all the query parameters and build an array with posts ID's as keys * and the featured image's url (in 'full size') as values. * * @since 1.5.9 * @return array the array with all the posts ID's and featured image url's. * */ public function _build_posts_array() { // checks if the post_slides array is cached if (!isset($this->post_slides)) { // if not, create it $this->post_slides = array(); // check if we have selected posts if (empty($this->settings->posts_post)) { // if not, create a default query with it $settings = !empty($this->settings) ? $this->settings : new stdClass(); // set WP_Query "fields" arg as 'ids' to return less information $settings->fields = 'ids'; // Get the query data. $query = FLBuilderLoop::query($settings); // build the post_slides array with post id's and featured image url's foreach ($query->posts as $key => $id) { $this->post_slides[$id] = $this->get_full_img_src($id); } } else { // if yes, get the selected posts and build the post_slides array $slides = explode(',', $this->settings->posts_post); foreach ($slides as $key => $id) { $this->post_slides[$id] = $this->get_full_img_src($id); } } } return $this->post_slides; }
<?php // Get the query data. $query = FLBuilderLoop::query($settings); // Render the posts. if ($query->have_posts()) { ?> <div class="fl-post-<?php echo $settings->layout; ?> " itemscope="itemscope" itemtype="http://schema.org/Blog"> <?php while ($query->have_posts()) { $query->the_post(); include apply_filters('fl_builder_posts_module_layout_path', $module->dir . 'includes/post-' . $settings->layout . '.php', $settings->layout); } ?> <div class="fl-post-grid-sizer"></div> </div> <div class="fl-clear"></div> <?php } // Render the pagination. if ($settings->pagination != 'none' && $query->have_posts()) { ?> <div class="fl-builder-pagination"<?php if ($settings->pagination == 'scroll') { echo ' style="display:none;"'; } ?> >
<?php // Get the query data. NULL because we have query-related settings yet. $query = FLBuilderLoop::query(NULL); if ($query->have_posts()) { ?> <div class="tesseract-post-list"> <?php while ($query->have_posts()) { $query->the_post(); ?> <?php include $module->dir . 'includes/post-list-' . $settings->post_display . '.php'; ?> <?php } ?> </div> <div class="tesseract-pagination"> <?php FLBuilderLoop::pagination($query); ?> </div> <?php } if (!$query->have_posts() && (defined('DOING_AJAX') || isset($_REQUEST['fl_builder']))) { ?> <div class="fl-post-grid-empty"><?php _e('No posts found.', 'fl-builder'); ?> </div>