Adds option to set max items number in related items.

This commit is contained in:
mateuswetah 2023-06-05 09:15:08 -03:00
parent 6ef60f3aad
commit 2a5c00aaea
2 changed files with 12 additions and 1 deletions

View File

@ -80,6 +80,15 @@ $options = [
] ]
] ]
], ],
$prefix . 'items_related_to_this_max_items_number' => [
'label' => __( 'Max amount of items to fetch', 'tainacan-blocksy' ),
'type' => 'ct-number',
'design' => 'inline',
'value' => 12,
'min' => 1,
'max' => 96,
'sync' => ''
],
$prefix . 'items_related_to_this_order' => [ $prefix . 'items_related_to_this_order' => [
'label' => __('Order by', 'blocksy'), 'label' => __('Order by', 'blocksy'),
'type' => 'ct-select', 'type' => 'ct-select',

View File

@ -5,6 +5,7 @@
$items_related_to_this_layout = get_theme_mod( $prefix . '_items_related_to_this_layout', 'carousel' ); $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_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 ); $max_items_per_screen = get_theme_mod( $prefix . '_items_related_to_this_max_items_per_screen', 6 );
$max_items_number = get_theme_mod( $prefix . '_items_related_to_this_max_items_number', 12 );
$order_option = get_theme_mod( $prefix . '_items_related_to_this_order', 'title_asc' ); $order_option = get_theme_mod( $prefix . '_items_related_to_this_order', 'title_asc' );
$image_size = get_theme_mod($prefix . '_items_related_to_this_image_size', 'tainacan-medium'); $image_size = get_theme_mod($prefix . '_items_related_to_this_image_size', 'tainacan-medium');
@ -35,6 +36,7 @@
'collection_heading_tag' => 'h3', 'collection_heading_tag' => 'h3',
'order' => $order, 'order' => $order,
'orderby' => $order_by, 'orderby' => $order_by,
'max_items_number' => $max_items_number,
'dynamic_items_args' => [ 'dynamic_items_args' => [
'max_columns_count' => $max_columns_count, 'max_columns_count' => $max_columns_count,
'image_size' => $image_size 'image_size' => $image_size