Advertisement
Guest User

wp-travel-button

a guest
Jun 10th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.91 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Itinerary Archive Contnet Template
  4.  *
  5.  * This template can be overridden by copying it to yourtheme/wp-travel/content-archive-itineraries.php.
  6.  *
  7.  * HOWEVER, on occasion wp-travel will need to update template files and you (the theme developer).
  8.  * will need to copy the new files to your theme to maintain compatibility. We try to do this.
  9.  * as little as possible, but it does happen. When this occurs the version of the template file will.
  10.  * be bumped and the readme will list any important changes.
  11.  *
  12.  * @see         http://docs.wensolutions.com/document/template-structure/
  13.  * @author      WenSolutions
  14.  * @package     wp-travel/Templates
  15.  * @since       1.0.0
  16.  */
  17.  
  18. if ( ! defined( 'ABSPATH' ) ) {
  19.     exit; // Exit if accessed directly
  20. }
  21. ?>
  22.  
  23. <?php
  24. do_action( 'wp_travel_before_archive_itinerary', get_the_ID() );
  25. if ( post_password_required() ) {
  26.     echo get_the_password_form();
  27.     return;
  28. }
  29.     $enable_sale    = wp_travel_is_enable_sale( get_the_ID() );
  30.     $group_size     = wp_travel_get_group_size( get_the_ID() );
  31.     $start_date     = get_post_meta( get_the_ID(), 'wp_travel_start_date', true );
  32.     $end_date       = get_post_meta( get_the_ID(), 'wp_travel_end_date', true ); ?>
  33.     <?php $view_mode = wp_travel_get_archive_view_mode(); ?>
  34.     <?php if ( 'list' === $view_mode ) : ?>
  35.         <article class="wp-travel-default-article">
  36.             <div class="wp-travel-article-image-wrap">
  37.                 <a href="<?php the_permalink(); ?>">
  38.                     <?php echo wp_travel_get_post_thumbnail( get_the_ID() ); ?>
  39.                 </a>
  40.                 <?php if ( $enable_sale ) : ?>
  41.                 <div class="wp-travel-offer">
  42.                     <span><?php esc_html_e( 'Offer', 'wp-travel' ); ?></span>
  43.                 </div>
  44.                 <?php endif; ?>
  45.             </div>
  46.             <div class="wp-travel-entry-content-wrapper">
  47.                 <div class="description-left">
  48.                     <?php do_action( 'wp_travel_before_archive_content_title', get_the_ID() ); ?>
  49.                     <?php wp_travel_do_deprecated_action( 'wp_tarvel_before_archive_title', array( get_the_ID() ), '2.0.4', 'wp_travel_before_archive_content_title' ); ?>
  50.                     <header class="entry-header">
  51.                         <h2 class="entry-title">
  52.                             <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute( array( 'before' => __( 'Permalink to: ', 'wp-travel' ) ) ); ?>">
  53.                                 <?php the_title(); ?>
  54.                             </a>
  55.                         </h2>
  56.                     </header><!-- .entry-header -->
  57.                     <?php do_action( 'wp_travel_after_archive_title', get_the_ID() ); ?>
  58.                     <div class="entry-content">
  59.                         <?php the_excerpt(); ?>
  60.  
  61.                     </div>
  62.                     <?php if ( wp_travel_tab_show_in_menu( 'reviews' ) ) : ?>
  63.                         <div class="wp-travel-average-review">
  64.                             <?php wp_travel_trip_rating( get_the_ID() ); ?>
  65.                             <?php $count = (int) wp_travel_get_review_count(); ?>
  66.                         </div>
  67.                         <span class="wp-travel-review-text"> (<?php printf( _n( '%d Review', '%d Reviews', $count, 'wp-travel' ), $count ); ?>)</span>
  68.                     <?php endif; ?>
  69.                     <div class="entry-meta">
  70.                         <div class="category-list-items">
  71.                             <span class="post-category">
  72.                                 <?php $terms = get_the_terms( get_the_ID(), 'itinerary_types' ); ?>
  73.                                 <?php if ( is_array( $terms ) && count( $terms ) > 0 ) : ?>
  74.                                     <i class="wt-icon-regular wt-icon-folder" aria-hidden="true"></i>
  75.                                     <?php
  76.                                     $first_term = array_shift( $terms );
  77.                                     $term_name = $first_term->name;
  78.                                     $term_link = get_term_link( $first_term->term_id, 'itinerary_types' ); ?>
  79.                                     <a href="<?php echo esc_url( $term_link, 'wp-travel' ); ?>" rel="tag">
  80.                                         <?php echo esc_html( $term_name ); ?>
  81.                                     </a>
  82.  
  83.                                     <?php if ( count( $terms ) > 0 ) : ?>
  84.                                     <div class="wp-travel-caret">
  85.                                         <i class="wt-icon wt-icon-caret-down"></i>
  86.  
  87.                                         <div class="sub-category-menu">
  88.                                             <?php foreach ( $terms as $term ) : ?>
  89.                                                 <?php
  90.                                                     $term_name = $term->name;
  91.                                                     $term_link = get_term_link( $term->term_id, 'itinerary_types' ); ?>
  92.                                                 <a href="<?php echo esc_url( $term_link, 'wp-travel' ); ?>">
  93.                                                     <?php echo esc_html( $term_name ); ?>
  94.                                                 </a>
  95.                                             <?php endforeach; ?>
  96.                                         </div>
  97.                                     </div>
  98.                                     <?php endif; ?>
  99.  
  100.                                 <?php endif; ?>
  101.                             </span>
  102.                         </div>
  103.                         <div class="travel-info">
  104.                             <i class="wt-icon wt-icon-child" aria-hidden="true"></i>
  105.                             <span class="value"><?php printf( '%s', $group_size ) ?></span>
  106.                         </div>
  107.  
  108.                         <div class="travel-info">
  109.                             <?php wp_travel_get_trip_duration( get_the_ID() ); ?>
  110.                         </div>
  111.                     </div>
  112.                 </div>
  113.                 <div class="description-right">
  114.                     <?php wp_travel_trip_price( get_the_ID() ); ?>
  115.                     <div class="wp-travel-explore">
  116.                             <a class="" href="<?php the_permalink(); ?>"><?php esc_html_e( 'Your Text', 'wp-travel' ); ?></a>
  117.                     </div>
  118.                 </div>
  119.             </div>
  120.         </article>
  121.     <?php else : ?>
  122.         <?php wp_travel_get_template_part( 'shortcode/itinerary', 'item' ); ?>
  123.     <?php endif; ?>
  124.  
  125. <?php do_action( 'wp_travel_after_archive_itinerary', get_the_ID() ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement