absint( $featured_block_number ), 'no_found_rows' => true, 'post_type' => 'post', 'meta_query' => array( array( 'key' => '_thumbnail_id' ), ), ); if ( $sticky ) { $qargs['post__in'] = $sticky; } // Fetch posts. $all_posts = get_posts( $qargs ); $items = array(); if ( ! empty( $all_posts ) ) { $cnt = 0; foreach ( $all_posts as $key => $post ) { if ( has_post_thumbnail( $post->ID ) ) { $image_array = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'blogism-block' ); $items[ $cnt ]['images'] = $image_array; $items[ $cnt ]['title'] = get_the_title( $post->ID ); $items[ $cnt ]['url'] = get_permalink( $post->ID ); $cnt++; } } } if ( ! empty( $items ) ) { $input = $items; } break; default: break; } return $input; } endif; if ( ! function_exists( 'blogism_add_featured_block' ) ) : /** * Add featured block. * * @since 1.0.0 */ function blogism_add_featured_block() { $flag_apply_status = apply_filters( 'blogism_filter_featured_block_status', false ); if ( true !== $flag_apply_status ) { return false; } $details = array(); $details = apply_filters( 'blogism_filter_featured_block_details', $details ); if ( empty( $details ) ) { return; } // Render featured block. blogism_render_featured_block( $details ); } endif; if ( ! function_exists( 'blogism_render_featured_block' ) ) : /** * Render featured block. * * @since 1.0.0 * * @param array $details Details. */ function blogism_render_featured_block( $details = array() ) { if ( empty( $details ) ) { return; } $featured_block_column = blogism_get_option( 'featured_block_column' ); ?> 0 ) { $input = true; } break; case 'blog-page': if ( ( 'posts' === $show_on_front && is_home() ) || ( $page_for_posts === $page_id && $page_for_posts > 0 ) ) { $input = true; } break; case 'home-blog-page': if ( ( $page_on_front === $page_id && $page_on_front > 0 ) || ( 'posts' === $show_on_front && is_home() ) || ( $page_for_posts === $page_id && $page_for_posts > 0 ) ) { $input = true; } break; default: break; } return $input; } endif;