* @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */
?>
<div id="comments"  >
<h4><?php 
the_title();
?>
: <?php 
_e('customer reviews and dealers', 'octa');
?>
</h4>
<?php 
if (function_exists('wp_review_show_total')) {
    wp_review_show_total();
}
if (get_field('reviews1name')) {
    ?>
<div class="review">
<img src="<?php 
    the_field('reviews1img');
    ?>
"  width="85" class="review-img" alt="<?php 
    the_field('reviews1name');
    ?>
 - <?php 
    the_field('reviews1named');
    ?>
 " />
<b><?php 
Esempio n. 2
0
									<img src="<?php 
                echo get_template_directory_uri();
                ?>
/images/nothumb.png" class="attachment-featured wp-post-image" alt="<?php 
                the_title();
                ?>
">
								</div>
								<div class="featured-cat"><?php 
                $category = get_the_category();
                echo $category[0]->cat_name;
                ?>
</div>
								<?php 
                if (function_exists('wp_review_show_total')) {
                    wp_review_show_total(true, 'latestPost-review-wrapper');
                }
                ?>
							</a>
						<?php 
            }
            ?>
					<?php 
        }
        ?>
					<header>						
						<h2 class="title">
							<a href="<?php 
        the_permalink();
        ?>
" title="<?php 
Esempio n. 3
0
function megamenu_thumbnails($thumbnail_html, $post_id)
{
    $thumbnail_html = '<div class="wpmm-thumbnail">';
    $thumbnail_html .= '<a title="' . get_the_title($post_id) . '" href="' . get_permalink($post_id) . '">';
    if (has_post_thumbnail($post_id)) {
        $thumbnail_html .= get_the_post_thumbnail($post_id, 'featured', array('title' => ''));
    } else {
        $thumbnail_html .= '<img src="' . get_template_directory() . '/images/nothumb-widgetfull.png" alt="' . __('No Preview', 'wpmm') . '"  class="wp-post-image" />';
    }
    $thumbnail_html .= '</a>';
    // WP Review
    $thumbnail_html .= function_exists('wp_review_show_total') ? wp_review_show_total(false) : '';
    $thumbnail_html .= '</div>';
    return $thumbnail_html;
}
Esempio n. 4
0
function wp_review_total_shortcode($atts, $content)
{
    if (empty($atts['class'])) {
        $atts['class'] = 'review-total-only review-total-shortcode';
    }
    return wp_review_show_total(false, $atts['class']);
}
Esempio n. 5
0
the_post_thumbnail('featured', array('title' => ''));
echo '</div>';
?>
            <?php 
if (get_post_meta($post->ID, 'mts_overall_score', true)) {
    ?>
              <span class="rating"><img src="<?php 
    bloginfo('template_directory');
    ?>
/images/stars/<?php 
    echo get_post_meta($post->ID, 'mts_overall_score', true);
    ?>
.png"/></span>
            <?php 
} elseif (function_exists('wp_review_show_total')) {
    wp_review_show_total(true, 'rating');
}
?>
          </a>
          <h3 class="title front-view-title"><a href="<?php 
the_permalink();
?>
" title="<?php 
the_title();
?>
"><?php 
the_title();
?>
</a></h3>
          <?php 
if ($mts_options['mts_home_headline_meta'] == '1') {
Esempio n. 6
0
    function mts_related_posts()
    {
        global $post;
        $mts_options = get_option(MTS_THEME_NAME);
        if (!empty($mts_options['mts_related_posts'])) {
            ?>
	
    		<!-- Start Related Posts -->
    		<?php 
            $empty_taxonomy = false;
            if (empty($mts_options['mts_related_posts_taxonomy']) || $mts_options['mts_related_posts_taxonomy'] == 'tags') {
                // related posts based on tags
                $tags = get_the_tags($post->ID);
                if (empty($tags)) {
                    $empty_taxonomy = true;
                } else {
                    $tag_ids = array();
                    foreach ($tags as $individual_tag) {
                        $tag_ids[] = $individual_tag->term_id;
                    }
                    $args = array('tag__in' => $tag_ids, 'post__not_in' => array($post->ID), 'posts_per_page' => $mts_options['mts_related_postsnum'], 'ignore_sticky_posts' => 1, 'orderby' => 'rand');
                }
            } else {
                // related posts based on categories
                $categories = get_the_category($post->ID);
                if (empty($categories)) {
                    $empty_taxonomy = true;
                } else {
                    $category_ids = array();
                    foreach ($categories as $individual_category) {
                        $category_ids[] = $individual_category->term_id;
                    }
                    $args = array('category__in' => $category_ids, 'post__not_in' => array($post->ID), 'posts_per_page' => $mts_options['mts_related_postsnum'], 'ignore_sticky_posts' => 1, 'orderby' => 'rand');
                }
            }
            if (!$empty_taxonomy) {
                $my_query = new wp_query($args);
                if ($my_query->have_posts()) {
                    echo '<div class="related-posts">';
                    echo '<h4>' . __('You may also like', 'mythemeshop') . '</h4>';
                    echo '<div class="clear">';
                    $posts_per_row = 3;
                    $j = 0;
                    while ($my_query->have_posts()) {
                        $my_query->the_post();
                        ?>
    			<article class="latestPost excerpt  <?php 
                        echo ++$j % $posts_per_row == 0 ? 'last' : '';
                        ?>
">
					<a href="<?php 
                        the_permalink();
                        ?>
" title="<?php 
                        the_title();
                        ?>
" rel="nofollow" id="featured-thumbnail">
					    <?php 
                        echo '<div class="featured-thumbnail">';
                        the_post_thumbnail('related', array('title' => ''));
                        echo '</div>';
                        ?>
                        <?php 
                        if (function_exists('wp_review_show_total')) {
                            wp_review_show_total(true, 'latestPost-review-wrapper');
                        }
                        ?>
					</a>
                    <header>
                        <h2 class="title front-view-title"><a href="<?php 
                        the_permalink();
                        ?>
" title="<?php 
                        the_title();
                        ?>
"><?php 
                        the_title();
                        ?>
</a></h2>
                        <?php 
                        if (!empty($mts_options["mts_single_headline_meta"])) {
                            ?>
                            <div class="post-info">
                                <?php 
                            if (!empty($mts_options["mts_single_headline_meta_info"]['author'])) {
                                ?>
                                    <span class="theauthor"><i class="fa fa-user"></i> <span itemprop="author"><?php 
                                the_author_posts_link();
                                ?>
</span></span>
                                <?php 
                            }
                            ?>
                                <?php 
                            if (!empty($mts_options["mts_single_headline_meta_info"]['date'])) {
                                ?>
                                    <span class="thetime updated"><i class="fa fa-calendar"></i> <span itemprop="datePublished"><?php 
                                echo human_time_diff(get_the_time('U'), current_time('timestamp')) . __(' ago', 'mythemeshop');
                                ?>
</span></span>
                                <?php 
                            }
                            ?>
                            </div>
                        <?php 
                        }
                        ?>
                    </header>
                </article><!--.post.excerpt-->
    			<?php 
                    }
                    echo '</div></div>';
                }
            }
            wp_reset_query();
            ?>
    		<!-- .related-posts -->
    	<?php 
        }
    }
Esempio n. 7
0
function megamenu_thumbnails($thumbnail_html, $post_id)
{
    $thumbnail_html = '<div class="wpmm-thumbnail">';
    $thumbnail_html .= '<a title="' . get_the_title($post_id) . '" href="' . get_permalink($post_id) . '">';
    if (has_post_thumbnail($post_id)) {
        $id = get_post_thumbnail_id();
        $image = wp_get_attachment_image_src($id, 'widgetfull');
        $image_url = $image[0];
        $thumbnail_html .= '<img src="' . $image_url . '" class="wp-post-image">';
    }
    $thumbnail_html .= '</a>';
    // WP Review
    $thumbnail_html .= function_exists('wp_review_show_total') ? wp_review_show_total(false) : '';
    $thumbnail_html .= '</div>';
    return $thumbnail_html;
}
Esempio n. 8
0
    function mts_archive_post($layout = '')
    {
        $mts_options = get_option(MTS_THEME_NAME);
        ?>
        <header>
            <h2 class="title front-view-title" itemprop="headline"><a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
            <?php 
        mts_the_postinfo();
        ?>
        </header>
        <a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        the_title();
        ?>
" rel="nofollow" class="post-image post-image-left">
            <?php 
        echo '<div class="featured-thumbnail">';
        the_post_thumbnail('featured', array('title' => ''));
        echo '</div>';
        ?>
            <?php 
        if (function_exists('wp_review_show_total')) {
            wp_review_show_total(true, 'latestPost-review-wrapper');
        }
        ?>
        </a>
        <?php 
        if (empty($mts_options['mts_full_posts'])) {
            ?>
            <div class="front-view-content">
                <?php 
            echo mts_excerpt(29);
            ?>
            </div>
            <?php 
            mts_readmore();
            ?>
        <?php 
        } else {
            ?>
            <div class="front-view-content full-post">
                <?php 
            the_content();
            ?>
            </div>
            <?php 
            if (mts_post_has_moretag()) {
                ?>
                <?php 
                mts_readmore();
                ?>
            <?php 
            }
            ?>
        <?php 
        }
    }
Esempio n. 9
0
    function ajax_wp_review_tab_widget_content()
    {
        $tab = $_POST['tab'];
        $args = $_POST['args'];
        $page = intval($_POST['page']);
        if ($page < 1) {
            $page = 1;
        }
        if (!is_array($args)) {
            return '';
        }
        // sanitize args
        $post_num = empty($args['post_num']) ? 5 : intval($args['post_num']);
        if ($post_num > 20 || $post_num < 1) {
            // max 20 posts
            $post_num = 5;
        }
        $thumb_size = $args['thumb_size'];
        if ($thumb_size != 'small' && $thumb_size != 'large') {
            $thumb_size = 'small';
            // default
        }
        $custom_reviews = array();
        if (!empty($args['custom_reviews'])) {
            $custom_reviews = explode(',', $args['custom_reviews']);
            $custom_reviews = array_map('trim', $custom_reviews);
            $custom_reviews = array_map('intval', $custom_reviews);
        }
        $show_date = !empty($args['show_date']);
        $allow_pagination = !empty($args['allow_pagination']);
        $review_type = '';
        if (in_array($args['review_type'], array('star', 'point', 'percentage'))) {
            $review_type = $args['review_type'];
        }
        $title_length = !empty($args['title_length']) ? $args['title_length'] : apply_filters('wpt_title_length_default', '15');
        switch ($tab) {
            case "toprated":
                $custom_query = array('ignore_sticky_posts' => 1, 'post_type' => 'any', 'posts_per_page' => $post_num, 'post_status' => 'publish', 'orderby' => 'meta_value_num', 'meta_key' => 'wp_review_total', 'order' => 'desc', 'paged' => $page);
                // Meta Query
                $custom_query['meta_query'] = array('relation' => 'AND');
                if (!empty($review_type)) {
                    $custom_query['meta_query'][] = array('key' => 'wp_review_type', 'compare' => '=', 'value' => $review_type);
                } else {
                    $custom_query['meta_query'][] = array('key' => 'wp_review_type', 'compare' => '!=', 'value' => '');
                }
                break;
            case "mostvoted":
                $most_voted = $this->get_most_voted();
                $custom_query = array('ignore_sticky_posts' => 1, 'post_type' => 'any', 'posts_per_page' => $post_num, 'post_status' => 'publish', 'orderby' => 'post__in', 'post__in' => $most_voted, 'paged' => $page);
                // Meta Query
                $custom_query['meta_query'] = array('relation' => 'AND');
                if (!empty($review_type)) {
                    $custom_query['meta_query'][] = array('key' => 'wp_review_type', 'compare' => '=', 'value' => $review_type);
                } else {
                    $custom_query['meta_query'][] = array('key' => 'wp_review_type', 'compare' => '!=', 'value' => '');
                }
                break;
            case "custom":
                $custom_query = array('ignore_sticky_posts' => 1, 'post_type' => 'any', 'posts_per_page' => $post_num, 'post_status' => 'publish', 'orderby' => 'post__in', 'post__in' => $custom_reviews, 'paged' => $page);
                break;
            case "recent":
            default:
                $custom_query = array('ignore_sticky_posts' => 1, 'post_type' => 'any', 'posts_per_page' => $post_num, 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'desc', 'paged' => $page);
                // Meta Query
                $custom_query['meta_query'] = array('relation' => 'AND');
                if (!empty($review_type)) {
                    $custom_query['meta_query'][] = array('key' => 'wp_review_type', 'compare' => '=', 'value' => $review_type);
                } else {
                    $custom_query['meta_query'][] = array('key' => 'wp_review_type', 'compare' => '!=', 'value' => '');
                }
                break;
        }
        ?>
      
		<ul>				
			<?php 
        $review_query = new WP_Query($custom_query);
        $last_page = $review_query->max_num_pages;
        while ($review_query->have_posts()) {
            $review_query->the_post();
            ?>
	
				<li>
					<a title="<?php 
            the_title();
            ?>
" rel="nofollow" href="<?php 
            the_permalink();
            ?>
">		
						<div class="wp_review_tab_thumbnail wp_review_tab_thumb_<?php 
            echo $thumb_size;
            ?>
">	
							<?php 
            if (has_post_thumbnail()) {
                ?>
	
								<?php 
                the_post_thumbnail('wp_review_' . $thumb_size, array('title' => ''));
                ?>
		
							<?php 
            } else {
                ?>
								<img src="<?php 
                echo WP_REVIEW_ASSETS . 'images/' . $thumb_size . 'thumb.png';
                ?>
" alt="<?php 
                the_title();
                ?>
" class="wp-post-image" />		
							<?php 
            }
            ?>
						</div>
					</a>
					<div class="title-right">
						<div class="entry-title"><a title="<?php 
            the_title();
            ?>
" href="<?php 
            the_permalink();
            ?>
"><?php 
            echo $this->post_title($title_length);
            ?>
</div></a>
						<?php 
            wp_review_show_total(true, 'review-total-only ' . $thumb_size . '-thumb');
            ?>
	                    <?php 
            if ($show_date) {
                ?>
	
							<div class="wp-review-tab-postmeta">								
								<?php 
                the_time('M j, Y');
                ?>
		
							</div> <!--end .entry-meta--> 				
						<?php 
            }
            ?>
	
					</div>				
					<div class="clear"></div>			
				</li>				
			<?php 
            $post_num++;
        }
        wp_reset_query();
        ?>
		
		</ul>
        <div class="clear"></div>
		<?php 
        if ($allow_pagination) {
            ?>
         
			<?php 
            $this->tab_pagination($page, $last_page);
            ?>
      
		<?php 
        }
        ?>
                      
		<?php 
        die;
        // required to return a proper result
    }
Esempio n. 10
0
    function ajax_wp_review_tab_widget_content()
    {
        $tab = $_POST['tab'];
        $args = $_POST['args'];
        $page = intval($_POST['page']);
        if ($page < 1) {
            $page = 1;
        }
        if (!is_array($args)) {
            return '';
        }
        // sanitize args
        $post_num = empty($args['post_num']) ? 5 : intval($args['post_num']);
        if ($post_num > 20 || $post_num < 1) {
            // max 20 posts
            $post_num = 5;
        }
        $box_layout = isset($args['box_layout']) ? $args['box_layout'] : 'horizontal-small';
        if ('horizontal-small' === $box_layout) {
            $thumbnail = 'widgetthumb';
            $open_li_item = '<li class="post-box horizontal-small horizontal-container"><div class="horizontal-container-inner">';
            $close_li_item = '</div></li>';
        } else {
            $thumbnail = 'widgetfull';
            $open_li_item = '<li class="post-box vertical-small">';
            $close_li_item = '</li>';
        }
        $custom_reviews = array();
        if (!empty($args['custom_reviews'])) {
            $custom_reviews = explode(',', $args['custom_reviews']);
            $custom_reviews = array_map('trim', $custom_reviews);
            $custom_reviews = array_map('intval', $custom_reviews);
        }
        $show_date = !empty($args['show_date']);
        $allow_pagination = !empty($args['allow_pagination']);
        $review_type = '';
        if (in_array($args['review_type'], array('star', 'point', 'percentage'))) {
            $review_type = $args['review_type'];
        }
        switch ($tab) {
            case "toprated":
                $custom_query = array('ignore_sticky_posts' => 1, 'post_type' => 'any', 'posts_per_page' => $post_num, 'post_status' => 'publish', 'orderby' => 'meta_value_num', 'meta_key' => 'wp_review_total', 'order' => 'desc', 'paged' => $page);
                // Meta Query
                $custom_query['meta_query'] = array('relation' => 'AND');
                if (!empty($review_type)) {
                    $custom_query['meta_query'][] = array('key' => 'wp_review_type', 'compare' => '=', 'value' => $review_type);
                } else {
                    $custom_query['meta_query'][] = array('key' => 'wp_review_type', 'compare' => '!=', 'value' => '');
                }
                break;
            case "mostvoted":
                $most_voted = $this->get_most_voted();
                $custom_query = array('ignore_sticky_posts' => 1, 'post_type' => 'any', 'posts_per_page' => $post_num, 'post_status' => 'publish', 'orderby' => 'post__in', 'post__in' => $most_voted, 'paged' => $page);
                // Meta Query
                $custom_query['meta_query'] = array('relation' => 'AND');
                if (!empty($review_type)) {
                    $custom_query['meta_query'][] = array('key' => 'wp_review_type', 'compare' => '=', 'value' => $review_type);
                } else {
                    $custom_query['meta_query'][] = array('key' => 'wp_review_type', 'compare' => '!=', 'value' => '');
                }
                break;
            case "custom":
                $custom_query = array('ignore_sticky_posts' => 1, 'post_type' => 'any', 'posts_per_page' => $post_num, 'post_status' => 'publish', 'orderby' => 'post__in', 'post__in' => $custom_reviews, 'paged' => $page);
                break;
            case "recent":
            default:
                $custom_query = array('ignore_sticky_posts' => 1, 'post_type' => 'any', 'posts_per_page' => $post_num, 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'desc', 'paged' => $page);
                // Meta Query
                $custom_query['meta_query'] = array('relation' => 'AND');
                if (!empty($review_type)) {
                    $custom_query['meta_query'][] = array('key' => 'wp_review_type', 'compare' => '=', 'value' => $review_type);
                } else {
                    $custom_query['meta_query'][] = array('key' => 'wp_review_type', 'compare' => '!=', 'value' => '');
                }
                break;
        }
        ?>
		<ul>
			<?php 
        $review_query = new WP_Query($custom_query);
        $last_page = $review_query->max_num_pages;
        while ($review_query->have_posts()) {
            $review_query->the_post();
            ?>
				<?php 
            echo $open_li_item;
            ?>
						<div class="post-img">
							<a rel="nofollow" href="<?php 
            the_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
">
								<?php 
            the_post_thumbnail($thumbnail, array('title' => ''));
            ?>
								<?php 
            wp_review_show_total(true, 'review-total-only');
            ?>
							</a>
						</div>
						<div class="post-data">
							<div class="post-data-container">
								<div class="post-title">
									<a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
"><?php 
            the_title();
            ?>
</a>
								</div>
								<div class="post-info">
									<?php 
            if ($show_date) {
                ?>
										<span class="thetime updated"><i class="fa fa-clock-o"></i> <?php 
                echo human_time_diff(get_the_time('U'), current_time('timestamp')) . __(' ago', 'mythemeshop');
                ?>
</span>
									<?php 
            }
            ?>
								</div><!--.post-info-->
							</div>
						</div>
				<?php 
            echo $close_li_item;
            ?>
			<?php 
            $post_num++;
        }
        wp_reset_query();
        ?>
		</ul>
		<div class="clear"></div>
		<?php 
        if ($allow_pagination) {
            ?>
			<?php 
            $this->tab_pagination($page, $last_page);
            ?>
		<?php 
        }
        ?>
		<?php 
        die;
        // required to return a proper result
    }