?> </span><?php if (!empty($aPostCustom['uni_price_val'][0])) { echo esc_html($aPostCustom['uni_price_val'][0]); } ?> </span> <em><?php if (!empty($aPostCustom['uni_period'][0])) { echo esc_html($aPostCustom['uni_period'][0]); } ?> </em> </div> <?php uni_excerpt(40, '', true); ?> <?php if (isset($aPostCustom['uni_order_button_ext_url_enable'][0]) && $aPostCustom['uni_order_button_ext_url_enable'][0] == 'on' && !empty($aPostCustom['uni_order_button_uri'][0])) { ?> <a href="<?php echo $aPostCustom['uni_order_button_uri'][0]; ?> " class="membership-card-order"><?php echo !empty($aPostCustom['uni_order_button_text'][0]) ? $aPostCustom['uni_order_button_text'][0] : __('Order Now', 'asana'); ?> </a> <?php } else { ?> <a href="#membershipCardOrderPopup" class="membershipCardOrder membership-card-order" data-priceid="<?php
<time class="postItemTime" datetime="<?php the_time('Y-m-d'); ?> "><?php the_time($sDateAndTimeFormat); ?> </time> <h4><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h4> <?php uni_excerpt(12, '', true); ?> </div> <?php } } else { ?> <?php get_template_part('no-results', 'archive'); ?> <?php } ?>
?> " alt="<?php the_title_attribute(); ?> "> <?php } ?> <div class="portfolioItemOverlay"></div> <div class="portfolioItemV2Desc"> <h4><?php the_title(); ?> </h4> <?php uni_excerpt(30, '', true); ?> <span><?php esc_html_e('view more', 'bauhaus'); ?> <i></i></span> </div> </a> <!-- End row --> <?php } ?> <?php $i++; } }
function uni_relative_posts_by_tags() { global $post; $oOriginalPost = $post; $aTags = wp_get_post_tags($post->ID); if (isset($aTags)) { $aRelativeTagArray = array(); foreach ($aTags as $oTag) { $aRelativeTagArray[] = $oTag->term_id; } $aRelatedArgs = array('post_type' => 'post', 'tag__in' => $aRelativeTagArray, 'post__not_in' => array($post->ID), 'posts_per_page' => 3, 'orderby' => 'rand', 'ignore_sticky_posts' => 1); $oRelatedQuery = new wp_query($aRelatedArgs); if ($oRelatedQuery->have_posts()) { echo '<div class="relatedPosts"> <div class="blockTitle">' . __('Related posts', 'asana') . '</div> <div class="blogPostWrap">'; while ($oRelatedQuery->have_posts()) { $oRelatedQuery->the_post(); $sRelatedPlaceholderImage = get_template_directory_uri() . '/images/placeholders/unithumb-blog.jpg'; ?> <div class="postItem"> <a href="<?php the_permalink(); ?> " class="postItemImg"> <?php if (has_post_thumbnail()) { ?> <?php the_post_thumbnail('unithumb-blog', array('alt' => the_title_attribute('echo=0'))); ?> <?php } else { ?> <img src="<?php echo esc_url($sRelatedPlaceholderImage); ?> " width="408" height="272" alt="<?php the_title_attribute(); ?> " /> <?php } ?> </a> <h4><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h4> <?php uni_excerpt(15, '', true); ?> </div> <?php } echo '</div> </div>'; } } $post = $oOriginalPost; wp_reset_postdata(); }