';
+
+ $popular_classes = array(
+ 'travel-popular-tilt-right',
+ 'travel-results-result',
+ 'travel-popular-tilt-left',
+ );
+
+ foreach ( $adventures as $index => $adventure ) {
+ $attachment_id = get_post_thumbnail_id( $adventure->ID );
+ $img_src = wp_get_attachment_image_url( $attachment_id, 'full' );
+ $img_srcset = wp_get_attachment_image_srcset( $attachment_id );
+ $price = get_post_meta( $adventure->ID, 'amp_travel_price', true );
+ $rating = round( (int) get_post_meta( $adventure->ID, 'amp_travel_rating', true ) );
+ $comments = wp_count_comments( $adventure->ID );
+ $locations = wp_get_post_terms( $adventure->ID, 'location', array(
+ 'fields' => 'names',
+ ) );
+
+ if ( is_wp_error( $locations ) || empty( $locations ) ) {
+ $location = '--';
+ } else {
+ $location = $locations[0];
+ }
+
+ $output .= '
+
+ ' . esc_html( get_the_title( $adventure->ID ) ) . '
+ •
+ $ ' . esc_html( $price ) . '
+
+
+
+
';
+
+ for ( $i = 0; $i < $rating; $i++ ) {
+ $output .= '★';
+ }
+
+ $output .= '
+
+
' .
+ /* translators: %d: The number of reviews */
+ sprintf( esc_html__( '%d Reviews', 'travel' ), esc_html( $comments->approved ) ) . '
+
+ ' . esc_html( $location ) . '
+
+
';
+
+ }
+
+ $output .= '