have_posts() ) {
global $wp_embed;
$ea_key = 1;
$eapro_allowed_description_tags = eapro_allowed_description_tags();
while ( $post_query->have_posts() ) {
$post_query->the_post();
$key = get_the_ID();
$post_title = get_the_title( $key );
$post_content = get_the_content();
// Generate accordion mode and icon markup.
$accordion_mode = self::accordion_mode( $eap_accordion_mode, $ea_key, $eap_expand_icon, $eap_collapse_icon );
$eap_exp_icon_markup = $eap_icon ? ' ' : '';
$data_sptarget = '#collapse' . $post_id . $key;
$eap_icon_markup = $eap_exp_icon_markup;
$eap_single_collapse = ! $eap_mutliple_collapse ? 'data-parent="#sp-ea-' . esc_attr( $post_id ) . '"' : '';
// Filter post title and content.
$content_title = apply_filters( 'sp_easy_accordion_post_title', $post_title );
$content = apply_filters( 'sp_easy_accordion_post_content', $post_content );
// Replace invalid characters and process block content if function exists.
$content = str_replace( ']]>', ']]>', $content );
if ( function_exists( 'do_blocks' ) && has_blocks( $content ) ) {
$content = do_blocks( $content );
}
// Process Elementor content.
if ( class_exists( '\Elementor\Plugin' ) && \Elementor\Plugin::instance()->documents->get( $key )->is_built_with_elementor() ) {
$content = \Elementor\Plugin::$instance->frontend->get_builder_content( $key, true );
}
// Include single item template.
require self::eap_locate_template( 'templates-parts/single-item.php' );
++$ea_key;
}
wp_reset_postdata();
}
// Include Schema markup template.
require SP_EA_PATH . 'public/partials/schema-markup.php';
?>