$sidebar = isset($sidebar_flag) && '1' != $sidebar_flag ? 'no' : $sidebar; while (have_posts()) { the_post(); ?> <section id="content" class="<?php echo esc_attr($sidebar); ?> -sidebar-page"> <div id="content-wrap" class="be-wrap clearfix"> <section id="page-content" class="content-single-sidebar"> <div class="clearfix <?php echo esc_attr($blog_style); ?> -blog"> <?php $blog_style = be_get_blog_loop_style($blog_style); get_template_part('blog/loop', $blog_style); ?> </div> <!-- End Page Content --> <div class="be-themes-comments"> <?php comments_template('', true); ?> </div> <!-- End Optional Page Comments --> </section> <?php if ('no' != $sidebar) { ?> <section id="<?php echo esc_attr($sidebar); ?>
echo esc_attr($items_per_page); ?> " data-paged="2" data-action="get_blog" <?php echo esc_attr($portfolio_wrap_style); ?> > <div class="clearfix <?php echo esc_attr($blog_style_class); ?> "> <?php if (isset($_GET['s']) && !empty($_GET['s'])) { if (have_posts()) { while (have_posts()) { the_post(); $blog_style = be_get_blog_loop_style($blog_attr['style']); get_template_part('blog/loop', $blog_style); } } else { echo '<p class="inner-content">' . __('Apologies, but no results were found. Perhaps searching will help find a related post.', 'be-themes') . '</p>'; } } else { echo '<p class="inner-content"> ' . __('Sorry, Please enter a search query', 'be-themes'); } ?> </div> <?php get_blog_pagination($blog_attr, $portfolio_pagination_style); ?> </div> </div>
function be_themes_get_blog() { extract($_POST); global $blog_attr; $blog_attr['gutter_width'] = !isset($_POST['gutter_width']) || empty($_POST['gutter_width']) ? intval(40) : intval($_POST['gutter_width']); $blog_attr['style'] = 'style3'; global $wp_query; if (!(is_category() || is_archive() || is_tag() || is_search())) { var_dump($wp_query); $args = array('paged' => $paged, 'post_status' => 'publish', 'ignore_sticky_posts' => true); query_posts($args); } if (have_posts()) { while (have_posts()) { the_post(); $blog_style = be_get_blog_loop_style($blog_attr['style']); get_template_part('blog/loop', $blog_style); } } wp_reset_postdata(); wp_reset_query(); die; }