The group size displayed on the single trip page is a crucial detail for potential travelers, outlining the minimum and maximum number of participants allowed for a trip. Customizing the group size allows you to tailor its presentation and enhance your websiteβs design and user experience. A presentation website can be a great tool to showcase this customization and improve your siteβs overall visual appeal. This short guide will help you customize the Group Size on the Single Trip Page.
The group size information is derived from the tripβs pricing details, specifically the min_pax (minimum group size) and max_pax (maximum group size) values. Below are examples of how you can customize the display and details on both single trip and archive pages.

Table of Contents
Adding the Code
To implement the customizations, add the following code snippets to the functions.php file of your child theme or use a plugin like code snippets to safely add custom PHP.
Customizing Group Size Display
1. Change Text Labels
This snippet modifies the group size display to show both the minimum and maximum values in the format:
“Minimum 1 – Maximum 20”.
function wp_travel_custom_single_archive_group_size( $group_size, $trip_id ) {
$min = 0;
$max = 0;
foreach( WP_Travel_Helpers_Trips::get_trip($trip_id )['trip']['pricings'] as $data ){
if( $min < $data['min_pax'] ){
$min = $data['min_pax'];
}
if( $max < $data['max_pax'] ){
$max = $data['max_pax'];
}
}
return '<li>
<div class="travel-info">
<strong class="title">Group Size</strong>
</div>
<div class="travel-info">
<span class="value"> Minimum ' . $min . ' - Maximum ' . $max . '</span>
</div>
</li>';
}
// Add the filter to modify the group size
add_filter( 'wp_travel_single_archive_group_size', 'wp_travel_custom_single_archive_group_size', 10, 2 );

2. Display Only the Minimum Group Size
To show only the minimum group size along with the label “Minimum”, use the following snippet:
function wp_travel_custom_single_archive_group_size( $group_size, $trip_id ) {
$min = 0;
$max = 0;
foreach( WP_Travel_Helpers_Trips::get_trip($trip_id )['trip']['pricings'] as $data ){
if( $min < $data['min_pax'] ){
$min = $data['min_pax'];
}
if( $max < $data['max_pax'] ){
$max = $data['max_pax'];
}
}
return '<li>
<div class="travel-info">
<strong class="title">Group Size</strong>
</div>
<div class="travel-info">
<span class="value"> Minimum ' . $min = $data['min_pax'] .
'</span>
</div>
</li>';
}
// Add the filter to modify the group size
add_filter( 'wp_travel_single_archive_group_size', 'wp_travel_custom_single_archive_group_size', 10, 2 );

3. Display Only the Maximum Group Size
To show only the maximum group size along with the label “Maximum”, use this snippet:
function wp_travel_custom_single_archive_group_size( $group_size, $trip_id ) {
$min = 0;
$max = 0;
foreach( WP_Travel_Helpers_Trips::get_trip($trip_id )['trip']['pricings'] as $data ){
if( $min < $data['min_pax'] ){
$min = $data['min_pax'];
}
if( $max < $data['max_pax'] ){
$max = $data['max_pax'];
}
}
return '<li>
<div class="travel-info">
<strong class="title">Group Size</strong>
</div>
<div class="travel-info">
<span class="value"> Maximum ' . $max = $data['max_pax'] .
'</span>
</div>
</li>';
}
// Add the filter to modify the group size
add_filter( 'wp_travel_single_archive_group_size', 'wp_travel_custom_single_archive_group_size', 10, 2 );

Conclusion
By following the steps above, you can effectively customize the Group Size on the Single Trip Page to align with your design and user experience goals.
Check WP Travel documentation to learn more about configurations, modules, payments, shortcodes, and the WP Travel Rest API.
Your feedback helps us improve. Please share your thoughts.
Need assistance? Contact our support team, join our Facebook community, and subscribe to our YouTube Channel for video tutorials. Thank you for choosing WP Travel.
If you are a WP Travel Free user thinking about upgrading to Pro, simply click on the banner below.

WP Travel Editorial is a team of WordPress and travel industry experts dedicated to delivering technical resources, travel business guides, and general travel insights. With over 10 years of experience, the team provides in-depth release notes, feature updates, and informative articles to help tour operators and travel enthusiasts succeed in the evolving travel landscape.
From plugin updates and industry trends to practical travel resources, WP Travel Editorial shares valuable content that supports both the travel industry and avid travelers.






