'; $boss_postid = get_option('page_for_posts'); $boss_default_sidebar_position = get_theme_mod('dp_default_sidebar_position'); $boss_widget_areas_sidebar = 'posts-widget-area'; //sidebar on left if(!empty($boss_widget_areas_sidebar) && is_active_sidebar($boss_widget_areas_sidebar) && $boss_default_sidebar_position == 'left'){ print ''; } //page content if(!empty($boss_widget_areas_sidebar) && is_active_sidebar($boss_widget_areas_sidebar)){ print '
'; }else{ print '
'; } $boss_bc = get_post_meta(get_the_ID(), 'dp_post_cats', true); if(is_array($boss_bc)){ $boss_categories_to_display = implode(',',$boss_bc); } if(!empty($_GET['cat'])){ $boss_categories_to_display = sanitize_key($_GET['cat']); } $boss_paged = get_query_var('paged'); if($boss_paged == ''){ $boss_paged = get_query_var('page'); } if(!empty($boss_categories_to_display)){ $boss_args=array( 'post_type' => 'post', 'paged' => $boss_paged, 'category_name' => $boss_categories_to_display, 'post__not_in' => get_option( 'sticky_posts' ) ); }else{ $boss_args=array( 'post_type' => 'post', 'paged' => $boss_paged, 'post__not_in' => get_option( 'sticky_posts' ) ); } //load sticky first $boss_sticky = get_option( 'sticky_posts' ); $boss_argsfirst = array( 'post__in' => $boss_sticky ); if ( isset($boss_sticky[0]) ) { $wp_query = new WP_Query( $boss_argsfirst ); while ( $wp_query->have_posts() ) { $wp_query->the_post(); get_template_part( 'content-blog' ); } } wp_reset_query(); //load normal posts w/o sticky posts $the_query = new WP_Query( $boss_args ); if($the_query->have_posts()){ while($the_query->have_posts()){ $the_query->the_post(); get_template_part( 'content-blog' ); } } //pagination if(function_exists('wp_paginate')) { wp_paginate(); } else{ //display default next/prev links if($the_query->max_num_pages > 1 ){ print '
'; print '

'.get_previous_posts_link('',$the_query->max_num_pages).''; previous_posts_link(__('  Previous Page ','boss')); print '

'; print '

- '; $boss_page_curr = (get_query_var('paged')) ? get_query_var('paged') : 1; print sprintf(__('PAGE %d OF %d','boss'),$boss_page_curr,$the_query->max_num_pages); print ' -

'; print '

'.get_next_posts_link('',$the_query->max_num_pages).''; next_posts_link(__('Next Page  ','boss'),$the_query->max_num_pages); print '

'; } } wp_reset_query(); wp_reset_postdata(); print '
'; //sidebar on right if(!empty($boss_widget_areas_sidebar) && is_active_sidebar($boss_widget_areas_sidebar) && $boss_default_sidebar_position != 'left'){ print ''; } print '
'; print '
'; get_footer(); ?>