blocksy_manager()->screen->get_prefix([ 'allowed_prefixes' => ['blog'], 'default_prefix' => 'blog' ]) ] ); $blog_post_structure = get_theme_mod($args['prefix'] . '_structure', 'grid'); $archive_order = get_theme_mod( $args['prefix'] . '_archive_order', apply_filters('blocksy:posts-listing:archive-order:default', [ [ 'id' => 'post_meta', 'enabled' => true, 'meta_elements' => blocksy_post_meta_defaults([ [ 'id' => 'categories', 'enabled' => true, ], ]), ], [ 'id' => 'title', 'enabled' => true, ], [ 'id' => 'featured_image', 'enabled' => true, ], [ 'id' => 'excerpt', 'enabled' => true, ], [ 'id' => 'read_more', 'enabled' => false, ], [ 'id' => 'post_meta', 'enabled' => true, 'meta_elements' => blocksy_post_meta_defaults([ [ 'id' => 'author', 'enabled' => true, ], [ 'id' => 'post_date', 'enabled' => true, ], [ 'id' => 'comments', 'enabled' => true, ], ]), ], [ 'id' => 'divider', 'enabled' => false ] ], $args['prefix']) ); $featured_image_settings = null; $excerpt_settings = null; $title_settings = null; $read_more_settings = null; $last_enabled_component = null; if (! $archive_order) { $archive_order = []; } foreach (array_reverse($archive_order) as $index => $value) { if ($value['enabled'] && ! $last_enabled_component) { if (! isset($value['__id'])) { $id = blocksy_rand_md5(); $archive_order[ count( $archive_order ) - 1 - $index ]['__id'] = $id; $value['__id'] = $id; } $last_enabled_component = $value['id'] . $value['__id']; } if ($value['id'] === 'featured_image') { $featured_image_settings = $value; } if ($value['id'] === 'read_more') { $read_more_settings = $value; } if ($value['id'] === 'excerpt') { $excerpt_settings = $value; } if ($value['id'] === 'post_meta') { $post_meta_settings = $value; } if ($value['id'] === 'title') { $title_settings = $value; } } if ($blog_post_structure === 'simple') { foreach ($archive_order as $index => $value) { if ($value['id'] === 'featured_image') { unset($archive_order[$index]); } } array_unshift($archive_order, $featured_image_settings); } $is_boundles = blocksy_default_akg('is_boundless', $featured_image_settings, 'yes'); $featured_image_size = blocksy_default_akg('image_size', $featured_image_settings, 'medium_large'); $has_title = false; foreach ($archive_order as $single_component) { if (! $single_component['enabled']) { continue; } if ($single_component['id'] === 'title') { $has_title = true; } } $featured_image_args = [ 'attachment_id' => get_post_thumbnail_id(), 'ratio' => blocksy_default_akg('thumb_ratio', $featured_image_settings, '4/3'), 'tag_name' => 'a', 'size' => $featured_image_size, 'html_atts' => [ 'href' => esc_url(get_permalink()), 'aria-label' => get_the_title() ], ]; if ($has_title) { $featured_image_args['html_atts']['tabindex'] = '-1'; } if ( $is_boundles === 'yes' && get_theme_mod($args['prefix'] . '_card_type', 'boxed') === 'boxed' && $blog_post_structure !== 'gutenberg' ) { $featured_image_args['class'] = 'boundless-image'; } $read_more_text = blocksy_translate_dynamic(blocksy_default_akg( 'read_more_text', $read_more_settings, __('Read More', 'blocksy') ), $args['prefix'] . '_archive_read_more_text'); $read_more_arrow = ''; if (blocksy_default_akg( 'read_more_arrow', $read_more_settings, 'no' ) === 'yes') { $read_more_text .= $read_more_arrow; } $button_type = blocksy_default_akg( 'button_type', $read_more_settings, 'background' ); $outputs = apply_filters('blocksy:archive:render-card-layers', [ 'title' => blocksy_entry_title(blocksy_default_akg('heading_tag', $title_settings, 'h2')), 'featured_image' => wp_get_attachment_url( $featured_image_args['attachment_id'] ) ? blocksy_image($featured_image_args) : '', 'excerpt' => blocksy_entry_excerpt( intval( blocksy_default_akg( 'excerpt_length', $excerpt_settings, '40' ) ) ), 'read_more' => blocksy_html_tag( 'a', [ 'class' => 'entry-button' . ( $button_type === 'background' ? ' ct-button' : '' ), 'data-type' => $button_type, 'data-alignment' => blocksy_default_akg( 'read_more_alignment', $read_more_settings, 'left' ), 'href' => esc_url( get_permalink() ) ], $read_more_text ), 'divider' => '
' ], $args['prefix']); $data_reveal_output = ''; if (get_theme_mod( blocksy_manager()->screen->process_allowed_prefixes( $args['prefix'], [ 'allowed_prefixes' => ['blog'], 'default_prefix' => 'blog' ] ) . '_has_posts_reveal', 'no' ) === 'yes') { $data_reveal_output = 'data-reveal="bottom:no"'; } $entry_open = '