'post', 'posts_per_page' => $count, 'ignore_sticky_posts' => 1, 'no_found_rows' => true, 'post__not_in' => $exclude_current && is_singular( 'post' ) ? array( (int) get_the_ID() ) : array(), 'meta_query' => array( array( 'key' => '_thumbnail_id', 'compare' => 'EXISTS' ) ), ) ); if ( ! $jq->have_posts() ) { return; } require_once dirname( __DIR__ ) . '/class-aieo-journal.php'; echo AIEO_Journal::section( $jq->posts, array( 'heading' => (string) ( $attributes['secHeading'] ?? '' ), 'level' => (int) ( $attributes['level'] ?? 2 ), 'all_text' => (string) ( $attributes['allText'] ?? '' ), 'all_href' => (string) ( $attributes['allHref'] ?? '' ), 'show_all' => ! isset( $attributes['showAll'] ) || (bool) $attributes['showAll'], 'wrapper' => array( 'class' => 'aieo-latest-posts-overlay aieo-journal', 'data-rooster-ui' => 'rooster-one/latest-posts-overlay', ), ) ); return; } if ( ! class_exists( 'AIEO_Block_Header' ) && defined( 'AIEO_DIR' ) ) { $hp = AIEO_DIR . 'includes/class-aieo-block-header.php'; if ( is_file( $hp ) ) { require_once $hp; } } $args = array( 'post_type' => 'post', 'posts_per_page' => $count, 'ignore_sticky_posts' => 1, 'no_found_rows' => true, ); if ( $exclude_current && is_singular( 'post' ) ) { $current = (int) get_the_ID(); if ( $current > 0 ) { $args['post__not_in'] = array( $current ); } } $q = new WP_Query( $args ); if ( ! $q->have_posts() ) { return; } $wrapper_cls = 'aieo-latest-posts-overlay aieo-latest-posts-overlay--' . $card_style; $wrapper_attrs = get_block_wrapper_attributes( array( 'class' => $wrapper_cls ) ); $header_html = class_exists( 'AIEO_Block_Header' ) ? AIEO_Block_Header::render( $attributes ) : ''; ob_start(); ?>