ID, 'dp-widget-areas-sidebar', true); //sidebar on left if(!empty($fourseasons_widget_areas_sidebar) && is_active_sidebar($fourseasons_widget_areas_sidebar) && $fourseasons_default_sidebar_position == 'left'){ print ''; } //page content if(!empty($fourseasons_widget_areas_sidebar) && is_active_sidebar($fourseasons_widget_areas_sidebar)){ print '
'; }else{ print '
'; } //load page content if (have_posts()) : while ( have_posts() ) : the_post(); print '
'; the_content(); print '
'; endwhile; endif; //category selector $bc = get_post_meta(get_the_ID(), 'dp_blog_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, 'posts_per_page' => 6 ); }else{ $args=array( 'post_type' => 'post', 'paged' => $paged, 'posts_per_page' => 6 ); } print '
'; $currpurl = get_permalink(); if(empty($_GET['cat'])){ $cats[] = ''.__('SHOW ALL','fourseasons').''; }else{ $cats[] = ''.__('SHOW ALL','fourseasons').''; } //show all child cats of current parent cat //foreach array if(is_array($bc)){ foreach($bc as $pfcat){ $allcats = get_categories(array( 'type' => 'post', 'child_of' => get_category_by_slug($pfcat)->term_id )); if(!empty($allcats)){ foreach($allcats as $ccats){ //create category url if(strstr($currpurl,'?')){ $caturl = $currpurl.'&cat='.$ccats->slug; }else{ $caturl = $currpurl.'?cat='.$ccats->slug; } if(!empty($_GET['cat']) && $_GET['cat'] == $ccats->slug){ $cats[] = ''.$ccats->name.''; }else{ $cats[] = ''.$ccats->name.''; } } } } } if(!empty($cats)){ print implode('   /   ',$cats); } print '
'; //load portfolio items $wp_query = new WP_Query( $args ); $pctr = 0; while ( $wp_query->have_posts() ) { $wp_query->the_post(); $pctr++; if($pctr == 3){ print ''; } } wp_reset_query(); wp_reset_postdata(); print '
'; //sidebar on right if(!empty($fourseasons_widget_areas_sidebar) && is_active_sidebar($fourseasons_widget_areas_sidebar) && $fourseasons_default_sidebar_position != 'left'){ print ''; } get_footer(); ?>