Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if ( ! function_exists( 'travel_log_front_page_testimonials_content_modified' ) ) :
- function travel_log_front_page_testimonials_content_modified() {
- // $enabled = travel_log_get_theme_option( 'testimonials_enable' );
- // if ( false === $enabled ) {
- // return;
- // }
- $title = travel_log_get_theme_option( 'testimonials_title' );
- $category = travel_log_get_theme_option( 'testimonials_category' );
- $testimonials_content_type = travel_log_get_theme_option( 'home_testimonials_content_type' );
- $bg_url = travel_log_get_theme_option( 'testimonials_bg_url' );
- $inline_style = ( '' !== $bg_url ) ? 'background-image: url( ' . esc_url( $bg_url ) . ' )' : '';
- ?>
- <section id="travel-testimonial" class="travel-testimonial" style="<?php echo esc_attr( $inline_style ); ?>">
- <div class="theme-overlay"></div>
- <div class="container">
- <div class="testimonial-wrapper">
- <div class="row">
- <div class="col-sm-10 col-xs-12">
- <?php if ( '' !== $title ) : ?>
- <h2 class="section-title"><?php echo esc_html( $title ); ?></h2>
- <?php endif; ?>
- </div>
- </div>
- <div class="row">
- <div class="container">
- <div class="col-sm-12">
- <!--travel featured slider-->
- <div id="testimonial-slider" class="testimonial-slider clearfix">
- <div class="testimonial slider" <?php echo is_rtl() ? 'dir="rtl"' : '' ; ?> >
- <?php
- if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'custom-content-types' ) && 'jetpack-testimonials' === $testimonials_content_type ) :
- $args['post_type'] = 'jetpack-testimonial';
- else :
- $args['category_name'] = $category;
- endif;
- $args['posts_per_page'] = apply_filters( 'travel_log_testimonials_posts_limit', 6 );
- $testimonials = new WP_Query( $args );
- if ( $testimonials->have_posts() ) :
- while ( $testimonials->have_posts() ) :
- $testimonials->the_post();
- ?>
- <div class="testimonial-content">
- <div class="client-img wrap">
- <?php
- if ( has_post_thumbnail() ) :
- the_post_thumbnail( 'thumbnail' );
- else :
- ?>
- <img src="<?php echo get_template_directory_uri() . '/images/dummy-user.jpg'; ?>">
- <?php
- endif;
- ?>
- </div>
- <div class="client-content">
- <div class="testimonial-quote-left clearfix">
- <i class="fa fa-quote-left" aria-hidden="true"></i>
- </div>
- <?php the_excerpt(); ?>
- <div class="client-bio"><div class="name-id"><?php the_title(); ?></div></div>
- <div class="testimonial-quote-right clearfix">
- <i class="fa fa-quote-right" aria-hidden="true"></i>
- </div>
- </div>
- </div>
- <?php
- endwhile;
- wp_reset_postdata();
- elseif ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'custom-content-types' ) && 'jetpack-testimonials' == $testimonials_content_type ) :
- if ( is_user_logged_in() && current_user_can( 'edit_posts' ) ) :?>
- <?php esc_html_e( 'Please add testimonial posts in the jetpack testimonials post type', 'travel-log' ); ?>
- <?php endif;
- endif; ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
- <?php
- }
- endif;
- function travel_log_front_page_testimonials_wrap_child() {
- $enabled = travel_log_get_theme_option( 'testimonials_enable' );
- if ( ! is_customize_preview() && false === $enabled ) {
- return;
- }
- echo '<div id="travel-log-front-page-testimonials-modified-wrap" class="travel-log-show-partial-edit-shortcut">';
- travel_log_front_page_testimonials_content_modified();
- echo '</div>';
- }
- add_action( 'travel_log_front_page_content', 'travel_log_front_page_testimonials_wrap_child', 51 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement