2021-07-08 02:21:21 +00:00
|
|
|
<?php
|
|
|
|
$prefix = blocksy_manager()->screen->get_prefix();
|
|
|
|
|
2021-10-14 19:12:44 +00:00
|
|
|
$section_label = get_theme_mod( $prefix . '_section_items_related_to_this_label', __( 'Items related to this', 'tainacan-blocksy' ) );
|
|
|
|
$items_related_to_this_layout = get_theme_mod( $prefix . '_items_related_to_this_layout', 'carousel' );
|
|
|
|
$max_columns_count = get_theme_mod( $prefix . '_items_related_to_this_max_columns_count', 4 );
|
|
|
|
$max_items_per_screen = get_theme_mod( $prefix . '_items_related_to_this_max_items_per_screen', 6 );
|
2024-09-16 18:22:27 +00:00
|
|
|
$variable_items_width = get_theme_mod( $prefix . '_items_related_to_this_variable_items_width', 'no') === 'yes';
|
2023-06-05 12:15:08 +00:00
|
|
|
$max_items_number = get_theme_mod( $prefix . '_items_related_to_this_max_items_number', 12 );
|
2023-05-10 17:57:33 +00:00
|
|
|
$order_option = get_theme_mod( $prefix . '_items_related_to_this_order', 'title_asc' );
|
2024-05-17 20:12:58 +00:00
|
|
|
$hide_collection_heading = get_theme_mod( $prefix . '_items_related_to_this_hide_collection_heading', 'no' ) === 'yes';
|
|
|
|
$hide_metadata_label = get_theme_mod( $prefix . '_items_related_to_this_hide_metadata_label', 'no' ) === 'yes';
|
|
|
|
$tainacan_view_mode = get_theme_mod( $prefix . '_items_related_to_this_tainacan_view_mode', 'records' );
|
2023-06-05 12:15:08 +00:00
|
|
|
|
2023-06-01 19:02:40 +00:00
|
|
|
$image_size = get_theme_mod($prefix . '_items_related_to_this_image_size', 'tainacan-medium');
|
2023-05-10 17:57:33 +00:00
|
|
|
|
|
|
|
$order_option_split = explode( '_', $order_option );
|
|
|
|
$order_by = $order_option_split[0] ? $order_option_split[0] : 'title';
|
|
|
|
$order = $order_option_split[1] ? $order_option_split[1] : 'asc';
|
|
|
|
|
|
|
|
if ( !in_array($order_by, [ 'title', 'date', 'modified' ]) )
|
|
|
|
$order_by = 'title';
|
|
|
|
|
|
|
|
if ( !in_array($order, [ 'asc', 'desc' ]) )
|
|
|
|
$order = 'asc';
|
2021-07-08 02:21:21 +00:00
|
|
|
|
|
|
|
if ( function_exists('tainacan_the_related_items_carousel') && (get_theme_mod( $prefix . '_display_items_related_to_this', 'no' ) === 'yes') && tainacan_has_related_items() ) : ?>
|
|
|
|
|
|
|
|
<section class="tainacan-item-section tainacan-item-section--items-related-to-this">
|
|
|
|
|
|
|
|
<?php if ( get_theme_mod($prefix . '_display_section_labels', 'yes') == 'yes' && $section_label != '') : ?>
|
|
|
|
<h2 class="tainacan-single-item-section" id="tainacan-item-items-related-to-this-label">
|
|
|
|
<?php echo esc_html( $section_label ); ?>
|
|
|
|
</h2>
|
|
|
|
<?php endif; ?>
|
|
|
|
<div class="tainacan-item-section__items-related-to-this">
|
|
|
|
<?php
|
|
|
|
tainacan_the_related_items_carousel([
|
2021-10-14 19:12:44 +00:00
|
|
|
'items_list_layout' => $items_related_to_this_layout,
|
2021-07-08 02:21:21 +00:00
|
|
|
'collection_heading_tag' => 'h3',
|
2023-05-10 17:57:33 +00:00
|
|
|
'order' => $order,
|
|
|
|
'orderby' => $order_by,
|
2023-06-05 12:15:08 +00:00
|
|
|
'max_items_number' => $max_items_number,
|
2024-05-17 20:12:58 +00:00
|
|
|
'hide_collection_heading' => $hide_collection_heading,
|
|
|
|
'hide_metadata_label' => $hide_metadata_label,
|
2021-10-14 19:12:44 +00:00
|
|
|
'dynamic_items_args' => [
|
2023-06-01 19:02:40 +00:00
|
|
|
'max_columns_count' => $max_columns_count,
|
2024-05-17 20:12:58 +00:00
|
|
|
'image_size' => $image_size,
|
|
|
|
'tainacan_view_mode' => $tainacan_view_mode,
|
2021-10-14 19:12:44 +00:00
|
|
|
],
|
2021-07-08 02:21:21 +00:00
|
|
|
'carousel_args' => [
|
2023-06-01 19:02:40 +00:00
|
|
|
'max_items_per_screen' => $max_items_per_screen,
|
2024-09-16 18:22:27 +00:00
|
|
|
'image_size' => $image_size,
|
|
|
|
'variable_items_width' => $variable_items_width,
|
2021-07-08 02:21:21 +00:00
|
|
|
]
|
|
|
|
]);
|
|
|
|
?>
|
|
|
|
<div>
|
|
|
|
|
|
|
|
</section>
|
|
|
|
<?php endif; ?>
|