public function widget($args, $instance) { extract($args); extract($instance); $query_arguments = array('posts_per_page' => (int) $number > 0 ? $number : -1); $query = new WP_Query($query_arguments); $posts = $query->get_posts(); $posts_html = ''; foreach ($posts as $post) { $post_thumb = 'yes' == $is_show_img ? adventure_tours_get_the_post_thumbnail($post->ID, self::$image_size) : ''; $post_date = 'yes' == $is_show_date ? get_the_date(null, $post->ID) : ''; $post_permalink = get_permalink($post->ID); $image_wrap_html = ''; if ($post_thumb) { $image_wrap_html = '<div class="widget-last-posts__item__container__item widget-last-posts__item__container__item--image">' . '<a href="' . esc_url($post_permalink) . '" class="widget-last-posts__item__image">' . $post_thumb . '</a>' . '</div>'; } $posts_html .= '<div class="widget-last-posts__item">' . '<div class="widget-last-posts__item__container' . ($post_thumb ? '' : ' widget-last-posts__item__container--without-img') . '">' . $image_wrap_html . '<div class="widget-last-posts__item__container__item widget-last-posts__item__info">' . '<div class="widget-last-posts__item__title"><a href="' . esc_url($post_permalink) . '">' . esc_html(get_the_title($post->ID)) . '</a></div>' . '<div class="widget-last-posts__item__date">' . esc_html($post_date) . '</div>' . '</div>' . '</div>' . '</div>'; } printf('%s<div class="widget-last-posts">%s%s</div>%s', $before_widget, $title ? $before_title . esc_html($title) . $after_title : '', $posts_html, $after_widget); }
* @version 1.2.0 */ get_header(); ?> <?php if (have_posts()) { ?> <?php while (have_posts()) { the_post(); ?> <div class="page-single row"> <main class="page-single__content col-md-9" role="main"> <?php print adventure_tours_get_the_post_thumbnail(null, 'thumb_single'); ?> <div class="section-white-box padding-all"><?php the_content(); ?> </div> </main> <?php get_sidebar(); ?> </div> <?php } } else { ?> <?php
$title_underline_class = $title_underline ? ' title--underline' : ''; ?> <div class="last-posts<?php if (!empty($css_class)) { echo ' ' . esc_attr($css_class); } ?> "> <?php if ($title) { echo do_shortcode('[title text="' . $title . '" size="small" position="center" decoration="on" underline="' . $title_underline . '" style="dark"]'); } foreach ($items as $post) { ?> <?php $image = adventure_tours_get_the_post_thumbnail($post->ID, 'thumb_last_posts_shortcode'); $classItem = $image ? ' last-posts__item--with-images' : ''; $post_link = get_the_permalink($post->ID); ?> <div class="last-posts__item<?php echo esc_attr($classItem); ?> "> <div class="last-posts__item__container"> <?php printf('<a href="%s" class="last-posts__item__image-wrap">%s</a>', esc_url($post_link), $image); ?> <div class="last-posts__item__content"> <h3 class="last-posts__item__title"><a href="<?php echo esc_url($post_link); ?>
$placeholder_image = adventure_tours_placeholder_img($view_settings['image_size']); ?> <div class="atgrid"> <div class="row atgrid__row"> <?php foreach ($items as $item_index => $post) { ?> <?php $item = wc_get_product($post); if (!$item) { continue; } $item_id = $item->id; $item_url = get_permalink($item_id); $image_html = adventure_tours_get_the_post_thumbnail($item_id, $view_settings['image_size']); $price_html = $item->get_price_html(); if ($item_index > 0 && $item_index % $view_settings['columns'] == 0) { echo '<div class="atgrid__row-separator clearfix hidden-sm hidden-xs"></div>'; } if ($item_index > 0 && $item_index % 2 == 0) { echo '<div class="atgrid__row-separator clearfix visible-sm visible-xs"></div>'; } ?> <div class="<?php echo esc_attr($item_wrapper_class); ?> "> <div class="atgrid__item"> <div class="atgrid__item__top"> <?php
echo 'dark' == $arrow_style ? ' atgrid__slider__controls--dark' : ''; ?> "> <a class="atgrid__slider__prev" href="#"><i class="fa fa-chevron-left"></i></a> <a class="atgrid__slider__next" href="#"><i class="fa fa-chevron-right"></i></a> </div> <div class="swiper-container swiper-slider atgrid__slider__container"> <div class="swiper-wrapper"> <?php foreach ($items as $item) { ?> <?php $post_id = $item->id; $item_url = get_permalink($post_id); $image_html = adventure_tours_get_the_post_thumbnail($post_id, $image_size); $price_html = $item->get_price_html(); ?> <div class="swiper-slide"> <div class="atgrid__item"> <div class="atgrid__item__top"> <?php printf('<a href="%s" class="atgrid__item__top__image">%s</a>', esc_url($item_url), $image_html ? $image_html : $placeholder_image); ?> <?php adventure_tours_renders_tour_badge(array('tour_id' => $post_id, 'wrap_css_class' => 'atgrid__item__angle-wrap', 'css_class' => 'atgrid__item__angle')); ?> <?php if ($price_html) { printf('<div class="atgrid__item__price"><a href="%s" class="atgrid__item__price__button">%s</a></div>', esc_url($item_url), $price_html); }
<?php /** * Content template part. * * @author Themedelight * @package Themedelight/AdventureTours * @version 1.0.0 */ $is_single = is_single(); $thumbnail = adventure_tours_get_the_post_thumbnail(get_the_ID(), 'thumb_single'); $thumbnail_url = wp_get_attachment_url(get_post_thumbnail_id()); $classWidthoutImage = empty($thumbnail) ? ' blog__item--without-image' : ''; $permalink = get_the_permalink(); ?> <article id="<?php echo get_post_type(); ?> -<?php the_ID(); ?> " <?php post_class('blog__item margin-bottom' . $classWidthoutImage); ?> itemscope itemtype="http://schema.org/BlogPosting"> <div class="blog__item__box"> <?php if (is_sticky()) { ?> <div class="blog__item__sticky"> <div class="blog__item__sticky__bg"><i class="fa fa-bookmark"></i></div>
$view_settings = apply_filters('adveture_tours_loop_settings', array('image_size' => 'thumb_tour_box')); ?> <div class="atlist"> <?php foreach ($items as $item_index => $post) { ?> <?php $item = wc_get_product($post); if (!$item) { continue; } $item_id = $item->id; $average = $item->get_average_rating(); $permalink = get_permalink($item_id); $title = get_the_title($item_id); $thumb_html = adventure_tours_get_the_post_thumbnail(null, $view_settings['image_size']); $price_html = $item->get_price_html(); ob_start(); adventure_tours_render_product_attributes(array('before' => '<div class="item-attributes item-attributes--style2">', 'after' => '</div>', 'before_each' => '<div class="item-attributes__item">', 'after_each' => '</div>', 'limit' => 3), $item_id); $attributes = ob_get_clean(); ?> <div class="atlist__item margin-bottom"> <div class="atlist__item__image"> <?php printf('<a class="atlist__item__image-wrap" href="%s">%s</a>', esc_url($permalink), $thumb_html ? $thumb_html : adventure_tours_placeholder_img($view_settings['image_size'])); ?> <?php if ($view_settings['show_categories']) { adventure_tours_render_tour_icons(array('before' => '<div class="atlist__item__icons">', 'after' => '</div>')); } ?>
/** * Tour details page, tab photos rendeing function. * * @return void */ function adventure_tours_render_tab_photos() { $thumbnail = adventure_tours_get_the_post_thumbnail(); if ($thumbnail) { wp_enqueue_style('swipebox'); wp_enqueue_script('swipebox'); TdJsClientScript::addScript('initProductSwiper', "jQuery('.woocommerce-main-image.swipebox,.thumbnails .swipebox').swipebox({useSVG : true, hideBarsDelay : 0});"); echo sprintf('<div class="row product-thumbnails"><div class="col-md-12"><a href="%s" class="swipebox" title="%s">%s</a></div></div>', esc_url(wp_get_attachment_url(get_post_thumbnail_id())), esc_attr(get_the_title()), $thumbnail); } woocommerce_show_product_thumbnails(); }