class="entry-title">
>
post_excerpt;
$excerpt = null;
if ($source === 'excerpt') {
if ($has_native_excerpt) {
$excerpt = get_the_excerpt($post_id);
$excerpt = apply_filters('blocksy:excerpt:output', $excerpt);
}
if (! $excerpt) {
ob_start();
blocksy_trim_excerpt(get_the_excerpt($post_id), $length);
$excerpt = ob_get_clean();
}
}
if ($source === 'full') {
ob_start();
the_content(
sprintf(
wp_kses(
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Continue reading "%s"', 'blocksy' ),
array(
'span' => array(
'class' => array(),
),
)
),
get_the_title()
)
);
$excerpt = ob_get_clean();
$excerpt = apply_filters('blocksy:excerpt:output', $excerpt);
}
ob_start();
?>
screen->get_prefix();
$title_class = 'item-title';
$title_class .= ' ' . blocksy_visibility_classes(get_theme_mod(
$prefix . '_post_nav_title_visibility',
[
'desktop' => true,
'tablet' => true,
'mobile' => false,
]
));
$thumb_class = '';
$thumb_class .= ' ' . blocksy_visibility_classes(get_theme_mod(
$prefix . '_post_nav_thumb_visibility',
[
'desktop' => true,
'tablet' => true,
'mobile' => true,
]
));
$container_class = 'post-navigation';
$container_class .= ' ' . blocksy_visibility_classes(get_theme_mod(
$prefix . '_post_nav_visibility',
[
'desktop' => true,
'tablet' => true,
'mobile' => true,
]
));
$home_page_url = get_home_url();
$post_slug = get_post_type_object(get_post_type())->labels->singular_name;
$post_slug = '' . $post_slug . '';
$next_post_image_output = '';
$previous_post_image_output = '';
if ($next_post) {
$next_title = '';
$next_title = get_the_title($next_post);
if (get_post_thumbnail_id($next_post)) {
$next_post_image_output = blocksy_image(
[
'attachment_id' => get_post_thumbnail_id($next_post),
'post_id' => $next_post->ID,
'ratio' => '1/1',
'class' => $thumb_class,
'inner_content' => '',
'tag_name' => 'figure'
]
);
}
}
if ($previous_post) {
$previous_title = '';
$previous_title = get_the_title($previous_post);
if (get_post_thumbnail_id($previous_post)) {
$previous_post_image_output = blocksy_image(
[
'attachment_id' => get_post_thumbnail_id($previous_post),
'post_id' => $previous_post->ID,
'ratio' => '1/1',
'class' => $thumb_class,
'inner_content' => '',
'tag_name' => 'figure'
]
);
}
}
ob_start();
?>
screen->get_prefix();
$per_page = intval(get_theme_mod($prefix . '_related_posts_count', 3));
$post_type = get_post_type($post);
$taxonomy = get_theme_mod(
$prefix . '_related_criteria',
array_keys(blocksy_get_taxonomies_for_cpt($post_type))[0]
);
$all_taxonomy_ids = [];
if ($taxonomy) {
$all_taxonomies = get_the_terms($post->ID, $taxonomy);
if ($all_taxonomies) {
foreach ($all_taxonomies as $current_taxonomy) {
if (isset($current_taxonomy->term_id)) {
$all_taxonomy_ids[] = $current_taxonomy->term_id;
}
}
}
}
$query_args = array_merge(
[
'ignore_sticky_posts' => 0,
'posts_per_page' => $per_page,
'post__not_in' => [$post->ID],
'post_type' => $post_type,
],
! empty($all_taxonomy_ids) ? [
'tax_query' => [
[
'field' => 'id',
'taxonomy' => $taxonomy,
'terms' => $all_taxonomy_ids,
]
]
] : []
);
$sort = get_theme_mod(
$prefix . '_related_sort',
'recent'
);
if ($sort !== 'default') {
$orderby_map = [
'random' => 'rand',
'recent' => 'post_date',
'commented' => 'comment_count'
];
if (isset($orderby_map[$sort])) {
$query_args['orderby'] = $orderby_map[$sort];
}
}
$query_args = apply_filters('blocksy:related-posts:query-args', $query_args);
$query = apply_filters(
'blocksy:related-posts:query',
new WP_Query($query_args),
$query_args,
$prefix
);
$label = apply_filters(
'blocksy:related-posts:module-label',
get_theme_mod(
$prefix . '_related_label',
__( 'Related Posts', 'blocksy')
)
);
$meta_elements = get_theme_mod(
$prefix . '_related_single_meta_elements',
blocksy_post_meta_defaults([
[
'id' => 'post_date',
'enabled' => true,
],
[
'id' => 'comments',
'enabled' => true,
],
])
);
$related_visibility = blocksy_visibility_classes(get_theme_mod(
$prefix . '_related_visibility',
[
'desktop' => true,
'tablet' => true,
'mobile' => true,
]
));
$class = trim(
'ct-related-posts-container' . ' ' . $related_visibility
);
$boxed_container_class = 'ct-related-posts';
if ($location !== 'separated') {
$boxed_container_class = trim(
$boxed_container_class . ' ' . $related_visibility
);
}
if (! $query->have_posts()) {
wp_reset_postdata();
return;
}
$label_tag = get_theme_mod($prefix . '_related_label_wrapper', 'h3');
$container_class = 'ct-container';
if (get_theme_mod($prefix . '_related_structure', 'normal') === 'narrow') {
$container_class = 'ct-container-narrow';
}
?>
< class="ct-block-title">
>
have_posts()) { ?>
the_post(); ?>
>
get_post_thumbnail_id(),
'post_id' => get_the_ID(),
'ratio' => get_theme_mod(
$prefix . '_related_featured_image_ratio',
'16/9'
),
'tag_name' => 'a',
'size' => get_theme_mod(
$prefix . '_related_featured_image_size',
'medium'
),
'html_atts' => [
'href' => esc_url( get_permalink() ),
'aria-label' => get_the_title(),
'tabindex' => "-1"
],
]
);
}
?>
'slash'
]);
?>