Example #1
0
function um_author_products_display($showposts = 4, $author = 0, $orderby = 'date')
{
    $is_vip = getUserMemberType($author);
    if ($is_vip) {
        $author_arg = $author;
    } else {
        $author_arg = 0;
    }
    $products_query = um_query_products($showposts, $author_arg, $orderby);
    if ($products_query->have_posts()) {
        while ($products_query->have_posts()) {
            $products_query->the_post();
            if (has_post_thumbnail()) {
                $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
                $imgsrc = $large_image_url[0];
            } else {
                $imgsrc = um_catch_first_image();
            }
            ?>
	<li><a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
" rel="bookmark" class="fancyimg">
		<div class="thumb-img">
			<img src="<?php 
            echo um_timthumb($imgsrc, 280, 180);
            ?>
" alt="<?php 
            the_title();
            ?>
">
			<span><i class="fa fa-shopping-cart"></i></span>
		</div>
		</a>
		<p><a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
"><?php 
            the_title();
            ?>
</a></p>
	</li>
<?php 
        }
    }
    wp_reset_query();
}
Example #2
0
    $tags = get_the_terms($post->ID, 'products_tag');
    $tagcount = $tags ? count($tags) : 0;
    $tagIDs = array();
    for ($i = 0; $i < $tagcount; $i++) {
        $tagIDs[] = $tags[$i]->term_id;
    }
    $args = array('term__in' => $tagIDs, 'post_type' => 'store', 'post__not_in' => array($post->ID), 'showposts' => 4, 'orderby' => 'rand', 'ignore_sticky_posts' => 1);
    $my_query = new WP_Query($args);
    if ($my_query->have_posts()) {
        while ($my_query->have_posts()) {
            $my_query->the_post();
            if (has_post_thumbnail()) {
                $large_image_url = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
                $imgsrc = $large_image_url[0];
            } else {
                $imgsrc = um_catch_first_image();
            }
            ?>
							<li>
								<a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            the_title();
            ?>
" rel="bookmark" class="fancyimg">
									<div class="thumb-img">
										<img src="<?php 
            echo um_timthumb($imgsrc, 280, 180);
            ?>
" alt="<?php