Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
remove_action( 'wp_travel_after_single_title', 'wp_travel_single_excerpt', 1 );
add_action( 'wp_travel_after_single_title', 'wp_travel_single_excerpt_customize', 1 );
function wp_travel_single_excerpt_customize( $post_id ) {
if ( ! $post_id ) {
return;
}
$wp_travel_itinerary = new WP_Travel_Itinerary();
?>
<div class="trip-short-desc">
<?php the_excerpt(); ?>
</div>
<div class="wp-travel-trip-meta-info">
<ul>
<?php
/**
* @since 1.0.4
*/
do_action( 'wp_travel_single_itinerary_before_trip_meta_list', $post_id );
?>
<li>
<div class="travel-info">
<strong class="title"><?php esc_html_e( 'Trip Type', 'wp-travel' ); ?></strong>
</div>
<div class="travel-info">
<span class="value">
<?php
$trip_types_list = $wp_travel_itinerary->get_trip_types_list();
if ( $trip_types_list ) {
echo wp_kses( $trip_types_list, wp_travel_allowed_html( array( 'a' ) ) );
} else {
echo esc_html( apply_filters( 'wp_travel_default_no_trip_type_text', __( 'No trip type', 'wp-travel' ) ) );
}
?>
</span>
</div>
</li>
<li>
<div class="travel-info">
<strong class="title"><?php esc_html_e( 'Weather and Terrain', 'wp-travel' ); ?></strong>
</div>
<div class="travel-info">
<span class="value">
<?php
$activity_list = $wp_travel_itinerary->get_activities_list();
if ( $activity_list ) {
echo wp_kses( $activity_list, wp_travel_allowed_html( array( 'a' ) ) );
} else {
echo esc_html( apply_filters( 'wp_travel_default_no_activity_text', __( 'No Activities', 'wp-travel' ) ) );
}
?>
</span>
</div>
</li>
<li>
<div class="travel-info">
<strong class="title"><?php esc_html_e( 'Group Size', 'wp-travel' ); ?></strong>
</div>
<div class="travel-info">
<span class="value">
<?php
if ( $group_size = $wp_travel_itinerary->get_group_size() ) {
printf( __( '%d', 'wp-travel' ), esc_html( $group_size ) );
} else {
echo esc_html( apply_filters( 'wp_travel_default_group_size_text', __( 'No Size Limit', 'wp-travel' ) ) );
}
?>
</span>
</div>
</li>
<?php if ( comments_open() ) : ?>
<li>
<div class="travel-info">
<strong class="title"><?php esc_html_e( 'Reviews', 'wp-travel' ); ?></strong>
</div>
<div class="travel-info">
<span class="value">
<?php
$count = (int) get_comments_number();
echo '<a href="javascript:void(0)" class="wp-travel-count-info">';
printf( _n( '%s review', '%s reviews', $count, 'wp-travel' ), $count );
echo '</a>'; ?>
</span>
</div>
</li>
<?php endif; ?>
<?php
/**
* @since 1.0.4
*/
do_action( 'wp_travel_single_itinerary_after_trip_meta_list', $post_id );
?>
</ul>
</div>
<div class="booking-form">
<div class="wp-travel-booking-wrapper">
<button class="wp-travel-booknow-btn"><?php esc_html_e( 'Book Now', 'wp-travel' ); ?></button>
</div>
</div>
<?php
/**
* @since 1.0.4
*/
do_action( 'wp_travel_single_after_booknow', $post_id );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment