Exemplo n.º 1
0
				<?php 
    lsx_entry_top();
    ?>
				
				<h1 class="title"><?php 
    the_title();
    ?>
</h1>

				<div class="entry-content">
				<?php 
    // load content
    if (function_exists('caldera_metaplate_from_file') && file_exists(get_stylesheet_directory() . 'templates/metaplate-single-tour.html')) {
        echo caldera_metaplate_from_file(get_stylesheet_directory() . 'templates/metaplate-single-tour.html', get_the_id());
    } elseif (function_exists('caldera_metaplate_from_file') && file_exists(LSX_TOURS_PATH . 'templates/metaplate-single-tour.html')) {
        echo caldera_metaplate_from_file(LSX_TOURS_PATH . 'templates/metaplate-single-tour.html', get_the_id());
    } else {
        the_content();
    }
    ?>
				</div><!-- .entry-content -->
				
				<?php 
    lsx_entry_bottom();
    ?>

			</article><!-- #post-## -->

			<?php 
    lsx_entry_after();
    ?>
Exemplo n.º 2
0
/**
 * Suggested Property
 *
 * @package 	happybeds-property
 * @subpackage	template-tags
 * @category	related
 *
 * @param		$before			html
 * @param		$after			html
 */
function happybeds_related_property()
{
    if (false == get_theme_mod('happybeds_property_single_display_related_property', true)) {
        return;
    }
    $filters = array('post_type' => 'property');
    //Get the settings from the customizer options
    $limit = get_theme_mod('happybeds_property_single_related_property_amount', '3');
    $filters['posts_per_page'] = $limit;
    //Exclude the current post
    $filters['post__not_in'] = array(get_the_ID());
    //if its set to related then we need to check by the type.
    $type = get_theme_mod('happybeds_property_single_related_property_type', 'random');
    if ('property-type' == $type) {
        $term = get_theme_mod('happybeds_property_single_related_property_type_term', false);
        $filters['orderby'] = 'rand';
        $current_post = get_queried_object_id();
        if (false != $current_post) {
            $terms = wp_get_object_terms($current_post, 'property-type');
            //only allow relation by 1 property type term
            if (is_array($terms) != $term) {
                foreach ($terms as $term) {
                    $filters[$type] = $term->slug;
                }
            }
        }
    } elseif ('featured' == $type) {
        $filters['meta_value'] = 1;
        $filters['meta_key'] = '_is_featured';
        $filters['orderby'] = 'rand';
    } else {
        $filters['orderby'] = $type;
    }
    $property_query = new WP_Query($filters);
    if ($property_query->have_posts()) {
        ?>
	<div id="related-properties" class="col-md-12">
		<h3>Related Campsites</h3>

		<div class="lsx-property-wrapper filter-items-wrapper">
			<div id="property-infinite-scroll-wrapper" class="filter-items-container lsx-property masonry">
	<?php 
        Lsx_Properties::remove_jetpack_sharing();
        while ($property_query->have_posts()) {
            $property_query->the_post();
            if (function_exists('caldera_metaplate_from_file') && file_exists(LSX_PROPERTIES_PATH . 'templates/metaplate-related-property.html')) {
                echo caldera_metaplate_from_file(LSX_PROPERTIES_PATH . 'templates/metaplate-related-property.html', get_the_id());
            }
        }
        echo '</div>';
        echo '</div>';
        echo '</div>';
        wp_reset_postdata();
    }
}
				<?php 
    while (have_posts()) {
        the_post();
        ?>


					<?php 
        $filters = array('post_type' => 'property');
        $filters['posts_per_page'] = -1;
        $property_query = new WP_Query($filters);
        if ($property_query->have_posts()) {
            while ($property_query->have_posts()) {
                $property_query->the_post();
                if (function_exists('caldera_metaplate_from_file') && file_exists(LSX_PROPERTIES_PATH . 'templates/metaplate-property-rates.html')) {
                    echo caldera_metaplate_from_file(LSX_PROPERTIES_PATH . 'templates/metaplate-property-rates.html', get_the_id());
                }
            }
            wp_reset_postdata();
        }
        ?>

				<?php 
    }
    ?>

			<?php 
} else {
    ?>

				<section class="no-results not-found">
 public function render_property_metaplate($content)
 {
     global $post;
     if (empty($post) || $post->post_type !== 'property' || !is_single()) {
         return $content;
     }
     return $content . caldera_metaplate_from_file(LSX_PROPERTIES_PATH . 'metaplates/metaplate-single-property.html', $post->ID);
 }