';
}
continue;
}
$post_meta_default = null;
if ('post_meta' === $single_component['id']) {
$total_metas = [];
foreach ($archive_order as $nested_single_component) {
if ($nested_single_component['id'] === 'post_meta') {
$total_metas[] = $nested_single_component;
}
}
if (count($total_metas) > 1 && !$had_a_meta) {
$post_meta_default = blocksy_post_meta_defaults([
[
'id' => 'categories',
'enabled' => true,
],
]);
} else {
$post_meta_default = blocksy_post_meta_defaults([
[
'id' => 'author',
'enabled' => true,
],
[
'id' => 'post_date',
'enabled' => true,
],
[
'id' => 'comments',
'enabled' => true,
],
]);
}
$had_a_meta = true;
}
$output = '';
if ('post_meta' === $single_component['id']) {
$output = blocksy_post_meta(
blocksy_akg(
'meta_elements',
$single_component,
$post_meta_default
),
[
'meta_type' => blocksy_akg('meta_type', $single_component, 'simple'),
'meta_divider' => blocksy_akg('meta_divider', $single_component, 'slash')
]
);
}
if (! $outputs) {
$outputs = apply_filters('blocksy:archive:render-card-layers', [
'title' => blocksy_entry_title(blocksy_default_akg('heading_tag', $title_settings, 'h2')),
'featured_image' => (
! get_the_post_thumbnail($featured_image_args['attachment_id'])
&&
! wp_get_attachment_image_url($featured_image_args['attachment_id'])
) ? '' : apply_filters(
'post_thumbnail_html',
blocksy_image($featured_image_args),
get_the_ID(),
$featured_image_args['attachment_id'],
$featured_image_args['size'],
''
),
'excerpt' => blocksy_entry_excerpt(
intval(
blocksy_default_akg( 'excerpt_length', $excerpt_settings, '40' )
),
'entry-excerpt',
null,
blocksy_default_akg(
'excerpt_source',
$excerpt_settings,
'excerpt'
)
),
'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']);
}
if (isset($outputs[$single_component['id']])) {
$output = $outputs[$single_component['id']];
}
$output = apply_filters(
'blocksy:archive:render-card-layer',
$output,
$single_component
);
if (! isset($single_component['__id'])) {
$single_component['__id'] = '';
}
if (
$card_type !== 'cover'
&&
$last_enabled_component === $single_component['id'] . $single_component['__id'] && (
strpos($last_enabled_component, 'post_meta') !== false
||
strpos($last_enabled_component, 'featured_image') !== false
)
) {
echo '';
}
/**
* Note to code reviewers: This line doesn't need to be escaped.
* Variabile $output used here escapes the value properly.
*/
echo $output;
if (
$blog_post_structure === 'simple'
&&
$single_component['id'] === 'featured_image'
) {
echo '';
}
if (
$blog_post_structure === 'simple'
&&
$last_enabled_component === $single_component[
'id'
] . $single_component['__id']
) {
echo '
';
}
}
do_action('blocksy:loop:card:end');
echo '';
}
}