<?php } else { ?> <!-- HOMEPAGE POST LIST (start) --> <div class="primary-post-list post_list_paginated post_list"> <?php if (have_posts()) { ?> <?php while (have_posts()) { the_post(); ?> <?php get_template_part('content', themeblvd_get_part('index')); ?> <?php } ?> <?php } else { ?> <p><?php echo themeblvd_get_local('archive_no_posts'); ?> </p> <?php } ?> <?php
<?php get_sidebar('left'); ?> <!-- CONTENT (start) --> <div id="content" class="<?php echo themeblvd_get_column_class('content'); ?> clearfix" role="main"> <div class="inner"> <?php themeblvd_content_top(); ?> <?php get_template_part('content', themeblvd_get_part('404')); ?> <?php themeblvd_content_bottom(); ?> </div><!-- .inner (end) --> </div><!-- #content (end) --> <!-- CONTENT (end) --> <?php get_sidebar('right'); ?> </div><!-- .grid-protection (end) --> </div><!-- .sidebar_layout-inner (end) -->
<div class="primary-post-list element-post_list_paginated post_list<?php echo themeblvd_get_classes('element_post_list_paginated', true); ?> "> <?php // Query the post list $post_list = new WP_Query(themeblvd_get_second_query()); // Start the loop if ($post_list->have_posts()) { while ($post_list->have_posts()) { $post_list->the_post(); global $more; $more = 0; // Get template part, framework default is content-list.php get_template_part('content', themeblvd_get_part('list_paginated')); } } else { // No posts to display printf('<p>%s</p>', themeblvd_get_local('archive_no_posts')); } themeblvd_pagination($post_list->max_num_pages); wp_reset_postdata(); ?> </div><!-- .post_list (end) --> <?php themeblvd_content_bottom(); ?> </div><!-- .inner (end) --> </div><!-- #content (end) -->
?> <?php while (have_posts()) { the_post(); ?> <?php get_template_part('content', themeblvd_get_part('search_results')); ?> <?php } ?> <?php } else { ?> <?php get_template_part('content', themeblvd_get_part('search')); ?> <?php } ?> <?php themeblvd_pagination(); ?> </div><!-- .blogroll (end) --> <!-- SEARCH POST LIST (end) --> <?php } ?>
<div id="content" class="<?php echo themeblvd_get_column_class('content'); ?> clearfix" role="main"> <div class="inner"> <?php themeblvd_content_top(); ?> <?php while (have_posts()) { the_post(); ?> <?php get_template_part('content', themeblvd_get_part('page')); ?> <?php themeblvd_page_footer(); ?> <?php if (themeblvd_supports('comments', 'pages')) { ?> <?php comments_template('', true); ?> <?php } ?>
/** * Display paginated post list or post grid * * @since 2.0.0 * * @param array $options all options for posts * @param string $type Type of posts, grid or list * @param string $current_location Current location of element, featured or primary */ function themeblvd_posts_paginated($args = array(), $type = 'list', $current_location = 'primary') { global $more; // Current location if relevant $location = themeblvd_set_att('location', $current_location); // Setup and extract $args $defaults = array('source' => '', 'categories' => array('all' => 1), 'tag' => '', 'thumbs' => 'default', 'content' => 'default', 'columns' => '3', 'rows' => '3', 'posts_per_page' => '6', 'orderby' => 'date', 'order' => 'DESC', 'offset' => '0', 'query' => '', 'crop' => ''); $args = wp_parse_args($args, $defaults); extract($args, EXTR_OVERWRITE); // Config before query string if ($type == 'grid') { $columns = themeblvd_set_att('columns', $columns); $posts_per_page = $rows ? $columns * $rows : '-1'; $args['posts_per_page'] = $posts_per_page; // Set new value to $args for parsing query $size = themeblvd_set_att('size', themeblvd_grid_class($columns)); $crop = !empty($crop) ? $crop : $size; $crop = themeblvd_set_att('crop', $crop); } else { $posts_per_page = themeblvd_set_att('posts_per_page', $posts_per_page); $content = $content == 'default' ? themeblvd_get_option('blog_content', null, 'content') : $content; $content = themeblvd_set_att('content', $content); $size = $thumbs == 'default' ? themeblvd_get_option('blog_thumbs', null, 'small') : $thumbs; $size = themeblvd_set_att('size', $size); } /*------------------------------------------------------*/ /* Query Args /*------------------------------------------------------*/ // Set the second query in global $themeblvd_query. // We only do this for paginated queries. $query_args = themeblvd_set_second_query($args, $type); // Sets global var and gets for local var // Apply filters $query_args = apply_filters('themeblvd_posts_args', $query_args, $args, $type, $current_location); /*------------------------------------------------------*/ /* The Loop /*------------------------------------------------------*/ // Query posts $posts = new WP_Query($query_args); // Start output echo '<div class="post_' . $type . '">'; if ($posts->have_posts()) { do_action('themeblvd_post_' . $type . '_paginated_before_loop', $args); if ($type == 'grid') { // Loop for post grid $counter = themeblvd_set_att('counter', 1); while ($posts->have_posts()) { $posts->the_post(); $more = 0; // If this is the very first post, open the first row if ($counter == 1) { themeblvd_open_row(); } // Get template part, framework default is content-grid.php get_template_part('content', themeblvd_get_part('grid_paginated')); // If last post in a row, close the row if ($counter % $columns == 0) { themeblvd_close_row(); } // If first post in a row, open the row if ($counter % $columns == 0 && $posts_per_page != $counter) { themeblvd_open_row(); } // Increment the counter with global template attribute accounted for $counter = themeblvd_set_att('counter', $counter + 1); } // In case the last row wasn't filled, close it now if ($counter - 1 != $posts_per_page) { themeblvd_close_row(); } } else { // Loop for post list while ($posts->have_posts()) { $posts->the_post(); $more = 0; // Get template part, framework default is content-list.php get_template_part('content', themeblvd_get_part('list_paginated')); } } do_action('themeblvd_post_' . $type . '_paginated_after_loop', $args); } else { // No posts to display printf('<p>%s</p>', themeblvd_get_local('archive_no_posts')); } // Pagination themeblvd_pagination($posts->max_num_pages); echo '</div><!-- .post_' . $type . ' (end) -->'; // Reset Post Data wp_reset_postdata(); }
<div id="content" class="<?php echo themeblvd_get_column_class('content'); ?> clearfix" role="main"> <div class="inner"> <?php themeblvd_content_top(); ?> <?php while (have_posts()) { the_post(); ?> <?php get_template_part('content', themeblvd_get_part('single')); ?> <?php themeblvd_single_footer(); ?> <?php if (themeblvd_supports('comments', 'posts')) { ?> <?php comments_template('', true); ?> <?php } ?>
<?php } else { ?> <!-- ARCHIVE POST LIST (start) --> <div class="post_list post_list_paginated archive"> <?php if (have_posts()) { ?> <?php while (have_posts()) { the_post(); ?> <?php get_template_part('content', themeblvd_get_part('archive')); ?> <?php } ?> <?php } else { ?> <p><?php echo themeblvd_get_local('archive_no_posts'); ?> </p> <?php } ?> <?php