diff --git a/tainacan-blocksy/inc/options/single-elements/items-related-to-this.php b/tainacan-blocksy/inc/options/single-elements/items-related-to-this.php index 8ce40ba..093f352 100644 --- a/tainacan-blocksy/inc/options/single-elements/items-related-to-this.php +++ b/tainacan-blocksy/inc/options/single-elements/items-related-to-this.php @@ -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' => [ 'label' => __('Order by', 'blocksy'), 'type' => 'ct-select', diff --git a/tainacan-blocksy/template-parts/tainacan-item-single-items-related-to-this.php b/tainacan-blocksy/template-parts/tainacan-item-single-items-related-to-this.php index 9c76107..8f3f1c9 100644 --- a/tainacan-blocksy/template-parts/tainacan-item-single-items-related-to-this.php +++ b/tainacan-blocksy/template-parts/tainacan-item-single-items-related-to-this.php @@ -5,8 +5,9 @@ $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 ); + $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' ); - + $image_size = get_theme_mod($prefix . '_items_related_to_this_image_size', 'tainacan-medium'); $order_option_split = explode( '_', $order_option ); @@ -35,6 +36,7 @@ 'collection_heading_tag' => 'h3', 'order' => $order, 'orderby' => $order_by, + 'max_items_number' => $max_items_number, 'dynamic_items_args' => [ 'max_columns_count' => $max_columns_count, 'image_size' => $image_size