Advertisement
Guest User

wp-travel

a guest
Dec 21st, 2018
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.50 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Itinerary Template : WP Travel
  4.  *
  5.  * @see         http://docs.wensolutions.com/document/template-structure/
  6.  * @author      WenSolutions
  7.  * @package     Travel_Log
  8.  * @since       1.1.0
  9.  */
  10.  
  11. if ( ! defined( 'ABSPATH' ) ) {
  12.     exit; // Exit if accessed directly.
  13. }
  14.  
  15. $enable_sale     = get_post_meta( get_the_ID(), 'wp_travel_enable_sale', true );
  16. $trip_price      = wp_travel_get_trip_price( get_the_ID() );
  17. $sale_price      = wp_travel_get_trip_sale_price( get_the_ID() );
  18. $trip_duration   = get_post_meta( get_the_ID(), 'wp_travel_trip_duration', true );
  19. $settings        = wp_travel_get_settings();
  20. $currency_code   = ( isset( $settings['currency'] ) ) ? $settings['currency'] : '';
  21. $currency_symbol = wp_travel_get_currency_symbol( $currency_code );
  22. $per_person_text = wp_travel_get_price_per_text( get_the_ID() );
  23. ?>
  24. <div class="post-item-wrapper trip-details">
  25.         <a href="<?php the_permalink(); ?>">
  26.             <div class="post-thumb">
  27.                 <?php
  28.                 if ( has_post_thumbnail() ) :
  29.  
  30.                     the_post_thumbnail( apply_filters( 'travel_log_trip_content_thumbnail_size', 'medium' ) );
  31.  
  32.                 else :
  33.  
  34.                     travel_log_no_slider_thumbnail();
  35.  
  36.                 endif; ?>
  37.             </div>
  38.             <span class="effect"></span>
  39.             <div class="post-content">
  40.                 <div class="trip-metas">
  41.                     <div class="clearfix title-price-wrapper" >
  42.                         <h4 class="post-title"><?php the_title(); ?></h4>
  43.                         <span class="trip-price">
  44.                             <span class="current-price">
  45.                                 <?php if ( true == $enable_sale && $sale_price ) : ?>
  46.                                     <del>
  47.                                 <?php endif; ?>
  48.                                 <?php printf( 'From %1s %2s', esc_html( $currency_symbol ), esc_html( $trip_price ) ); ?>
  49.                                 <?php if ( true == $enable_sale && $sale_price ) : ?>
  50.                                     </del>
  51.                                 <?php endif; ?>
  52.                                 </span>
  53.                                 <?php if ( true == $enable_sale && $sale_price ) : ?>
  54.                                 <span class="sale-price"><?php printf( '%1s %2s', esc_html( $currency_symbol ), esc_html( $sale_price ) ); ?></span>
  55.                                 <?php endif; ?>
  56.                             </span>
  57.                             <span class="per-person-text"><?php echo esc_html( $per_person_text ); ?></span>
  58.                         </span>
  59.                     </div>
  60.                     <?php wp_travel_get_trip_duration( get_the_ID() ); ?>
  61.                     <div class="clearfix" >
  62.                         <?php
  63.                         if ( wp_travel_tab_show_in_menu( 'reviews' ) ) { ?>
  64.                             <?php $average_rating = wp_travel_get_average_rating(); ?>
  65.                                 <div class="wp-travel-average-review" title="<?php printf( esc_attr__( 'Rated %s out of 5', 'travel-log' ), $average_rating ); ?>">
  66.                                     <span style="width:<?php echo esc_attr( ( $average_rating / 5 ) * 100 ); ?>%">
  67.                                         <strong itemprop="ratingValue" class="rating"><?php echo esc_html( $average_rating ); ?></strong> <?php printf( esc_html__( 'out of %1$s5%2$s', 'travel-log' ), '<span itemprop="bestRating">', '</span>' ); ?>
  68.                                     </span>
  69.                                 </div>
  70.                             <span class="rating-count"><?php printf( esc_html__('( %s Reviews )', 'travel-log'), wp_travel_get_rating_count() ); ?></span>
  71.                         <?php }
  72.                         ?>
  73.                         <?php $terms = get_the_terms( get_the_ID(), 'itinerary_types' ); ?>
  74.                         <?php
  75.                         if ( is_array( $terms ) && count( $terms ) > 0 ) :
  76.                             $first_term = array_shift( $terms );
  77.                             $term_name = $first_term->name; ?>
  78.                             <span class="trip-category"><?php echo esc_html( $term_name ); ?></span>
  79.                         <?php endif; ?>
  80.                     </div>
  81.                 </div>
  82.             </div>
  83.             <?php if ( $enable_sale && $sale_price ) : ?>
  84.             <div class="wp-travel-offer">
  85.                 <span><?php esc_html_e( 'Offer', 'travel-log' ); ?></span>
  86.             </div>
  87.             <?php endif; ?>
  88.     </a>
  89. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement