$category_id , 'posts_per_page' => -1 ); $query = new WP_Query($args); if($query->have_posts()): while($query->have_posts()): $query->the_post(); if(has_post_thumbnail()) { $image_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($image_id,'',true); ?>
term_id; $category_name[] = $category->slug; } $bloge_plus_cat_post_args = array( 'category__in' => $category_ids, 'post__not_in' => array($post_id), 'post_type' => 'post', 'posts_per_page' => 3, 'post_status' => 'publish', 'ignore_sticky_posts' => true ); $bloge_plus_featured_query = new WP_Query($bloge_plus_cat_post_args); ?> is_home && $query->is_main_query() ) { $bloge_theme_options = bloge_get_theme_options(); $catid = $bloge_theme_options['bloge-feature-cat']; $exclude_categories = $catid; if (!empty($exclude_categories)) { $cats = explode(',', $exclude_categories); $cats = array_filter($cats, 'is_numeric'); $string_exclude = ''; echo $string_exclude; if (!empty($cats)) { $string_exclude = '-' . implode(',-', $cats); $query->set('cat', $string_exclude); } } } return $query; } endif; } add_filter('pre_get_posts', 'bloge_exclude_category_in_blog_page'); /** * Sanitize checkbox field * * @since Bloge 1.0.0 */ if (!function_exists('bloge_sanitize_checkbox')) : function bloge_sanitize_checkbox($checked) { // Boolean check. return ((isset($checked) && true == $checked) ? true : false); } endif;