'; } print '
'; $dp_default_sidebar_position = get_theme_mod('dp_default_sidebar_position'); $dp_widget_areas_sidebar = get_post_meta($post->ID, 'dp-widget-areas-sidebar', true); //sidebar on left if(!empty($dp_widget_areas_sidebar) && is_active_sidebar($dp_widget_areas_sidebar) && $dp_default_sidebar_position == 'left'){ print ''; } if(!empty($dp_widget_areas_sidebar) && is_active_sidebar($dp_widget_areas_sidebar)){ print '
'; }else{ print '
'; } //content if (have_posts()){ print '
'; while ( have_posts() ){ the_post(); $cnt = get_the_content(); the_content(); wp_link_pages( array( 'before' => '' ) ); } print '
'; if(!empty($cnt)){ print '
'; } } //blog $bc = get_post_meta(get_the_ID(), 'dp_post_cats', true); if(is_array($bc)){ $categories_to_display = implode(',',$bc); } if(!empty($_GET['cat'])){ $categories_to_display = sanitize_key($_GET['cat']); } $paged = get_query_var('paged'); if($paged == ''){ $paged = get_query_var('page'); } if(!empty($categories_to_display)){ $args=array( 'post_type' => 'post', 'paged' => $paged, 'category_name' => $categories_to_display, 'post__not_in' => get_option( 'sticky_posts' ) ); }else{ $args=array( 'post_type' => 'post', 'paged' => $paged, 'post__not_in' => get_option( 'sticky_posts' ) ); } //load sticky first $sticky = get_option( 'sticky_posts' ); $argsfirst = array( 'post__in' => $sticky ); if ( isset($sticky[0]) ) { $wp_query = new WP_Query( $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( $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 '

- '; $page_curr = (get_query_var('paged')) ? get_query_var('paged') : 1; print sprintf(__('PAGE %d OF %d','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($dp_widget_areas_sidebar) && is_active_sidebar($dp_widget_areas_sidebar) && $dp_default_sidebar_position != 'left'){ print ''; } print '
'; print '
'; get_footer(); ?>