示例#1
0
function caption_handler($atts, $content = null, $code = "")
{
    /* title */
    if (isset($atts["title"])) {
        $title_i = $atts["title"];
    } else {
        $title_i = "";
    }
    /* url */
    if (isset($atts["url"])) {
        $url_i = $atts["url"];
    } else {
        $url_i = "";
    }
    $image = get_post_thumb(false, 340, 225, false, $url_i);
    $blog_url = get_template_directory_uri();
    $return = '		
				<div class="image-caption aligncenter">
					<a href="' . $url_i . '" class="lightbox-photo" title="' . $title_i . '">
						<img alt="' . $title_i . '" src="' . $image['src'] . '" />
					</a>

					<p>' . $title_i . '</p>
				</div>
				';
    return $return;
}
    /**
     * How to display the widget on the screen.
     */
    function widget($args, $instance)
    {
        extract($args);
        /* Our variables from the widget settings. */
        $title = apply_filters('widget_title', $instance['title']);
        $tags = $instance['tags'];
        $number = $instance['number'];
        global $post;
        if (!empty($tags)) {
            $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'tag' => $tags);
        } else {
            $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1);
        }
        $loop = new WP_Query($query);
        /* Before widget (defined by themes). */
        echo $before_widget;
        if ($loop->have_posts()) {
            /* Display the widget title if one was input (before and after defined by themes). */
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>
		<div class="postimageside">		
		<?php 
            while ($loop->have_posts()) {
                $loop->the_post();
                ?>
		<?php 
                $img = get_post_thumb();
                ?>
	
		<div class="wrap">
			<a href="<?php 
                the_permalink();
                ?>
" class="view-link">
				<?php 
                wpsm_thumb('grid_news');
                ?>
				<h4><?php 
                the_title();
                ?>
</h4>
			</a>	
		</div>	
		<?php 
            }
            ?>
		</div>
		<?php 
            wp_reset_query();
            ?>
		<?php 
        }
        ?>
			
	<?php 
        /* After widget (defined by themes). */
        echo $after_widget;
    }
示例#3
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $count = $instance['count'];
        ?>
              <?php 
        echo $before_widget;
        ?>
	

					<div class="title"><h3><?php 
        echo $title;
        ?>
</h3></div>
					<!-- BEGIN .popular-galleries -->
					<div class="popular-galleries">
				
						<?php 
        $args = array('post_status' => null, 'numberposts' => $count, 'post_type' => 'gallery');
        $posts = get_posts($args);
        if (count($posts) > 0) {
            foreach ($posts as $post) {
                $image = get_post_thumb($post->ID, 51, 51);
                ?>
										<a href="<?php 
                echo get_permalink($post->ID);
                ?>
">
											<img src="<?php 
                echo $image['src'];
                ?>
" alt="<?php 
                echo $post->title;
                ?>
" title="<?php 
                echo $post->title;
                ?>
" width="51" height="51" />
										</a>

										<?php 
            }
        }
        ?>
					<!-- END .popular-galleries -->
					</div>
					

												
				<?php 
        echo $after_widget;
        ?>
        <?php 
    }
示例#4
0
function gallery_handler($atts, $content = null, $code = "")
{
    if (isset($atts['url'])) {
        if (substr($atts['url'], -1) == '/') {
            $atts['url'] = substr($atts['url'], 0, -1);
        }
        $vars = explode('/', $atts['url']);
        $slug = $vars[count($vars) - 1];
        $page = get_page_by_path($slug, 'OBJECT', OT_POST_GALLERY);
        if (is_object($page)) {
            $id = $page->ID;
            if (is_numeric($id)) {
                $gallery_style = get_post_meta($id, THEME_NAME . "_gallery_style", true);
                $galleryImages = get_post_meta($id, THEME_NAME . "_gallery_images", true);
                $imageIDs = explode(",", $galleryImages);
                $count = count($imageIDs);
                if ($gallery_style == "lightbox") {
                    $classL = 'light-show ';
                } else {
                    $classL = false;
                }
                $content .= '<div class="gallery-preview-box-wrapper">';
                $content .= '<div class="gallery-preview-box">';
                $content .= '<p><b>' . __("Photo gallery:", THEME_NAME) . '</b> ' . $page->post_title . '</p>';
                $counter = 1;
                foreach ($imageIDs as $imgID) {
                    if ($counter == 5) {
                        break;
                    }
                    if ($imgID) {
                        $file = wp_get_attachment_url($imgID);
                        $image = get_post_thumb(false, 80, 80, false, $file);
                        $content .= '<a href="' . $atts['url'] . '?page=' . $counter . '" class="border-image ' . $classL . '" data-id="gallery-' . $id . '">
														<img src="' . $image['src'] . '" alt="' . $page->post_title . '" title="' . $page->post_title . '" data-id="' . $counter . '"/>
													</a>';
                    }
                    $counter++;
                }
                $content .= '<a href="' . $atts['url'] . '" class="show-all-photos">' . __("show<br/>all<br/>photos", THEME_NAME) . '</a>';
                $content .= '</div>';
                $content .= '</div>';
            } else {
                $content .= "Incorrect URL attribute defined";
            }
        } else {
            $content .= "Incorrect URL attribute defined";
        }
    } else {
        $content .= "No url attribute defined!";
    }
    return $content;
}
示例#5
0
文件: thumbs.php 项目: bangjojo/wp
function add_image_thumb_2($content)
{
    global $post;
    $img = get_post_thumb($post->ID, 600, 180);
    if ($img['show'] != false) {
        if ($img['src'] != "") {
            $img = '<img src="' . $img['src'] . '" alt="article-image" class="post-image-2" width="600" height="180"/>';
            return $img . " " . $content;
        } else {
            return $content;
        }
    } else {
        return $content;
    }
}
示例#6
0
function add_image_thumb($content)
{
    global $post;
    $img = get_post_thumb($post->ID, 680, 230);
    if ($img['show'] != false) {
        if ($img['src'] != "") {
            $img = '<a href="#" class="image-overlay-1 main-image"><span><img src="' . $img['src'] . '" class="trans-1" alt="' . get_the_title() . '"/></span></a>';
            return $img . " " . $content;
        } else {
            return $content;
        }
    } else {
        return $content;
    }
}
示例#7
0
if (is_category()) {
    $blogStyle = ot_get_option($catId, "blog_style");
} else {
    $blogStyle = get_option(THEME_NAME . "_blog_style");
}
if (!isset($blogStyle) || $blogStyle == "") {
    $blogStyle = get_option(THEME_NAME . "_blog_style");
}
if ($blogStyle == "2") {
    $width = 600;
    $height = 180;
} else {
    $width = 100;
    $height = 100;
}
$image = get_post_thumb($post->ID, $width, $height);
if (get_option(THEME_NAME . "_show_first_thumb") == "on" && $image['show'] == true) {
    ?>

	<div class="image">
		<a href="<?php 
    the_permalink();
    ?>
">
			<?php 
    echo ot_image_html($post->ID, $width, $height);
    ?>
		</a>
	</div>

<?php 
示例#8
0
function OT_lightbox_gallery()
{
    $g = $_POST['gallery_id'];
    $next_image = $_POST['next_image'];
    $galleryImages = get_post_meta($g, THEME_NAME . "_gallery_images", true);
    $imageIDs = explode(",", $galleryImages);
    $c = 0;
    $images = array();
    $thumbs = array();
    foreach ($imageIDs as $id) {
        $file = wp_get_attachment_url($id);
        $image = get_post_thumb(false, 650, 0, false, $file);
        $images[] = $image['src'];
        $thumb = get_post_thumb(false, 110, 110, false, $file);
        $thumbs[$c] = $thumb['src'];
        $c++;
    }
    $thispost = get_post($g);
    $content = do_shortcode($thispost->post_content);
    $return = array();
    $return['next'] = $images[$next_image - 1];
    $return['thumbs'] = $thumbs;
    $return['title'] = get_the_title($g);
    $return['content'] = $content;
    $return['total'] = $c;
    echo json_encode($return);
    die;
}
示例#9
0
<?php

//social share icons
$shareAll = get_option(THEME_NAME . "_share_all");
$shareSingle = get_post_meta($post->ID, THEME_NAME . "_share_single", true);
$image = get_post_thumb($post->ID, 0, 0);
?>

		<?php 
if ($shareAll == "show" || $shareAll == "custom" && $shareSingle == "show") {
    ?>
				<hr />
				<div>
					<a href="http://www.facebook.com/sharer/sharer.php?u=<?php 
    the_permalink();
    ?>
" data-url="<?php 
    the_permalink();
    ?>
" data-url="<?php 
    the_permalink();
    ?>
" class="soc-share i-facebook ot-share">
						<i class="fa fa-facebook"></i><?php 
    _e("Facebook", THEME_NAME);
    ?>
<span class="count">0</span>
					</a>
				</div>
				<div>
					<a href="#" data-hashtags="" data-url="<?php 
示例#10
0
        if ($my_query->have_posts()) {
            while ($my_query->have_posts()) {
                $my_query->the_post();
                ?>
													
													<?php 
                if ($counter == 1) {
                    ?>
<!-- BEGIN .row --><div class="row"> <?php 
                }
                ?>
													
													<!-- BEGIN .index-item -->
													<div class="index-item">
														<?php 
                $src = get_post_thumb($post->ID, 135, 135);
                ?>
														<a href="<?php 
                the_permalink();
                ?>
"><img src="<?php 
                echo $src["src"];
                ?>
" alt="<?php 
                the_title();
                ?>
" width="135" height="135"/></a>
														<a href="<?php 
                the_permalink();
                ?>
"><?php 
// Exit if accessed directly
global $post, $product, $woocommerce;
$attachment_ids = $product->get_gallery_attachment_ids();
if ($attachment_ids) {
    ?>
	<div class="woocommerce-pager"><?php 
    $loop = 0;
    $columns = apply_filters('woocommerce_product_thumbnails_columns', 3);
    foreach ($attachment_ids as $attachment_id) {
        $classes = array('');
        if ($loop == 0 || $loop % $columns == 0) {
            $classes[] = 'first';
        }
        if (($loop + 1) % $columns == 0) {
            $classes[] = 'last';
        }
        $image_link = wp_get_attachment_url($attachment_id);
        if (!$image_link) {
            continue;
        }
        $image = get_post_thumb(false, 60, 60, false, $image_link);
        $image_class = esc_attr(implode(' ', $classes));
        $image_title = esc_attr(get_the_title($attachment_id));
        $image = '<img src="' . $image["src"] . '" alt="' . $image_title . '" title="' . $image_title . '" />';
        echo apply_filters('woocommerce_single_product_image_thumbnail_html', sprintf('<a href="%s" class="%s" title="%s" data-slide-index="%s">%s</a>', $image_link, $image_class, $image_title, $loop, $image), $attachment_id, $post->ID, $image_class);
        $loop++;
    }
    ?>
</div>
	<?php 
}
            ?>
                <div class="edd_download" itemtype="http://schema.org/Product" itemscope="">
                    <div class="edd_download_inner">
                        <div class="edd_download_image">
                            <?php 
            if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
                ?>
                                <a href="<?php 
                the_permalink();
                ?>
">
                                <?php 
                if (rehub_option('aq_resize') == 1) {
                    ?>
                                    <?php 
                    $img = get_post_thumb();
                    ?>
 
                                    <img src="<?php 
                    $params = array('width' => 336, 'height' => 220);
                    echo bfi_thumb($img, $params);
                    ?>
" alt="<?php 
                    the_title_attribute();
                    ?>
" />
                                <?php 
                } else {
                    ?>
    
                                    <?php 
示例#13
0
/**
 * Get thumbnails. Return a string
 * Default size is 150 X 150 (px)
 * 
 * @since 1.0
 */
function lo_get_thumb($width = 150, $height = 150, $img = '')
{
    global $post;
    if ($img) {
        return '<img itemprop="image" src="' . get_template_directory_uri() . '/timthumb.php?src=' . $img . '&amp;h=' . $height . '&amp;w=' . $width . '&amp;a=c" alt="' . get_the_title($post->ID) . '">';
    }
    $img = get_post_thumb();
    if ($img) {
        return '<img itemprop="image" src="' . get_template_directory_uri() . '/timthumb.php?src=' . $img . '&amp;h=' . $height . '&amp;w=' . $width . '&amp;a=c" alt="' . get_the_title($post->ID) . '">';
    }
}
示例#14
0
    function rehub_create_column($size = 'middle')
    {
        ?>
<article class="rething_item small_post inf_scr_item">
    <?php 
        if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
            ?>
        <figure>
            <?php 
            rehub_formats_icons('full');
            ?>
            <span class="pattern"></span>
            <?php 
            echo getPostLikeLink(get_the_ID());
            ?>
            <?php 
            rehub_permalink();
            ?>
                <?php 
            $img = get_post_thumb();
            $nothumb = get_stylesheet_directory_uri() . '/images/noim.png';
            if ($size == 'middle') {
                $params = array('width' => 381, 'height' => 255, 'crop' => true);
            } elseif ($size == 'small') {
                $params = array('width' => 280, 'height' => 186, 'crop' => true);
            } elseif ($size == 'big') {
                $params = array('width' => 579, 'height' => 386, 'crop' => true);
            } else {
                $params = array('width' => 381, 'height' => 255, 'crop' => true);
            }
            ?>
				<?php 
            if (!empty($img)) {
                ?>
                	<img src="<?php 
                echo bfi_thumb($img, $params);
                ?>
" alt="<?php 
                the_title_attribute();
                ?>
" />
                <?php 
            } else {
                ?>
    
                    <img src="<?php 
                echo $nothumb;
                ?>
" alt="<?php 
                the_title_attribute();
                ?>
" />
                <?php 
            }
            ?>
            </a>
        </figure>                                     
    <?php 
        }
        ?>
    <div class="wrap_thing">
        <div class="top">
            <?php 
        $category = get_the_category(get_the_ID());
        ?>
            <?php 
        if ($category) {
            $first_cat = $category[0]->term_id;
            meta_small(false, $first_cat, false, false);
        }
        ?>
        </div>
        <div class="hover_anons">
            <h2><?php 
        rehub_permalink();
        the_title();
        ?>
</a></h2>
            <div class="post-meta"> <?php 
        meta_small(true, false, true, false);
        ?>
 </div>
            <?php 
        rehub_format_score('small');
        ?>
            <p><?php 
        kama_excerpt('maxchar=320');
        ?>
</p>
        </div>
        <?php 
        rehub_create_btn('yes');
        ?>
    </div>
</article>

<?php 
    }
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $countP = $instance['count_p'];
        $countR = $instance['count_r'];
        $countC = $instance['count_c'];
        //popular post args
        $argsP = array('posts_per_page' => $countP, 'order' => 'DESC', 'orderby' => 'meta_value_num', 'meta_key' => THEME_NAME . '_post_views_count', 'post_type' => 'post');
        //recent post args
        $argsR = array('posts_per_page' => $countR);
        //commnet post args
        $argsC = array('status' => 'approve', 'order' => 'DESC', 'number' => $countC);
        $comments = get_comments($argsC);
        $totalCount = count($comments);
        $the_query_p = new WP_Query($argsP);
        $the_query_r = new WP_Query($argsR);
        //post counts
        $totalCountP = $the_query_p->found_posts;
        $totalCountR = $the_query_r->found_posts;
        $blogID = get_option('page_for_posts');
        $postDate = get_option(THEME_NAME . "_post_date");
        $postComments = get_option(THEME_NAME . "_post_comment");
        ?>
		
	<?php 
        echo $before_widget;
        ?>
		<?php 
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>
			<div class="tabs">

				<ul class="tab-navi">
					<li class="active"><a href="#"><span><?php 
        _e("Popular", THEME_NAME);
        ?>
</span></a></li>
					<li><a href="#"><span><?php 
        _e("Recent", THEME_NAME);
        ?>
</span></a></li>
					<li><a href="#"><span><?php 
        _e("Comments", THEME_NAME);
        ?>
</span></a></li>
				</ul>

				<!-- BEGIN .latest-activity -->
				<div class="latest-activity active">
					<?php 
        if ($the_query_p->have_posts()) {
            while ($the_query_p->have_posts()) {
                $the_query_p->the_post();
                ?>
					<?php 
                $image = get_post_thumb($the_query_p->post->ID, 0, 0);
                ?>
	
						<div class="activity-item<?php 
                if ($image['show'] != true) {
                    ?>
 no-image<?php 
                }
                ?>
">
							<div class="image">
								<?php 
                if ($image['show'] == true) {
                    ?>
									<a href="<?php 
                    the_permalink();
                    ?>
">
										<?php 
                    echo ot_image_html($the_query_p->post->ID, 60, 60);
                    ?>
									</a>
								<?php 
                }
                ?>
							</div>
							<div class="text">
								<h5><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h5>
								<p><a href="<?php 
                the_permalink();
                ?>
" class="more-link"><i><?php 
                _e("Read more", THEME_NAME);
                ?>
</i></a></p>
							</div>
						</div>
					<?php 
            }
        } else {
            ?>
						<p><?php 
            _e('No posts where found', THEME_NAME);
            ?>
</p>
					<?php 
        }
        ?>
				<!-- END .latest-activity -->
				</div>

				<!-- BEGIN .latest-activity -->
				<div class="latest-activity">
					<?php 
        if ($the_query_r->have_posts()) {
            while ($the_query_r->have_posts()) {
                $the_query_r->the_post();
                ?>
					<?php 
                $image = get_post_thumb($the_query_r->post->ID, 0, 0);
                ?>
	
						<div class="activity-item<?php 
                if ($image['show'] != true) {
                    ?>
 no-image<?php 
                }
                ?>
">
							<div class="image">
								<?php 
                if ($image['show'] == true) {
                    ?>
									<a href="<?php 
                    the_permalink();
                    ?>
">
										<?php 
                    echo ot_image_html($the_query_r->post->ID, 60, 60);
                    ?>
									</a>
								<?php 
                }
                ?>
							</div>
							<div class="text">
								<h5><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h5>
								<p><a href="<?php 
                the_permalink();
                ?>
" class="more-link"><i><?php 
                _e("Read more", THEME_NAME);
                ?>
</i></a></p>
							</div>
						</div>
					<?php 
            }
        } else {
            ?>
						<p><?php 
            _e('No posts where found', THEME_NAME);
            ?>
</p>
					<?php 
        }
        ?>
				<!-- END .latest-activity -->
				</div>

				<!-- BEGIN .latest-activity -->
				<div class="latest-activity">
				<?php 
        foreach ($comments as $comment) {
            if ($comment->user_id && $comment->user_id != "0") {
                $authorName = get_the_author_meta('display_name', $comment->user_id);
            } else {
                $authorName = $comment->comment_author;
            }
            ?>

					<div class="activity-item">
						<div class="image">
							<a href="<?php 
            echo get_comment_link($comment);
            ?>
">
								<img src="<?php 
            echo get_avatar_url(get_avatar($comment, 60));
            ?>
" alt="<?php 
            echo $authorName;
            ?>
" />
							</a>
						</div>
						<div class="text">
							<h5><a href="<?php 
            echo get_comment_link($comment);
            ?>
"><?php 
            echo $authorName;
            ?>
</a></h5>
							<p><?php 
            comment_excerpt($comment->comment_ID);
            ?>
</p>
							<p><a href="<?php 
            echo get_comment_link($comment);
            ?>
" class="more-link"><i><?php 
            _e("View article", THEME_NAME);
            ?>
</i></a></p>
						</div>
					</div>
				<?php 
        }
        ?>
				<!-- END .latest-activity -->
				</div>

			</div>

	<?php 
        echo $after_widget;
        ?>
		
	
      <?php 
    }
示例#16
0
    function widget($args, $instance)
    {
        extract($args);
        $title = apply_filters('widget_title', $instance['title']);
        $count = $instance['count'];
        $widget_id = $args['widget_id'];
        ?>
		
				<!-- BEGIN .sidebar-block-1 -->
				<?php 
        echo $before_widget;
        ?>

					<div class="title"><h3><?php 
        if ($title) {
            echo $title;
        }
        ?>
</h3></div>
					
					<!-- BEGIN .tabs-1 -->
					<div class="tabs-1">
						<table>
							<tr>
								<td><a href="#" class="tab-1 bordeaux_triple_btn active" id="bordeaux_triple_popular_btn_<?php 
        echo $widget_id;
        ?>
"><span><?php 
        printf(__('Popular', 'bordeaux'));
        ?>
</span></a></td>
								<td><a href="#" class="tab-1 tab-1-disabled bordeaux_triple_btn" id="bordeaux_triple_recent_btn_<?php 
        echo $widget_id;
        ?>
"><span><?php 
        printf(__('Recent', 'bordeaux'));
        ?>
</span></a></td>
								<td><a href="#" class="tab-1 tab-1-disabled bordeaux_triple_btn" id="bordeaux_triple_comments_btn_<?php 
        echo $widget_id;
        ?>
"><span><?php 
        printf(__('Comments', 'bordeaux'));
        ?>
</span></a></td>
							</tr>
						</table>
					<!-- END .tabs-1 -->
					</div>
				
					<!-- BEGIN .latest-activity -->
					<div class="latest-activity" id="bordeaux_triple_popular_<?php 
        echo $widget_id;
        ?>
">
							<?php 
        add_filter('posts_where', 'filter_where');
        $args = array('posts_per_page' => $count, 'orderby' => 'comment_count');
        $the_query = new WP_Query($args);
        remove_filter('posts_where', 'filter_where');
        ?>
							<?php 
        $counter = 1;
        ?>
							<?php 
        if ($the_query->have_posts()) {
            while ($the_query->have_posts()) {
                $the_query->the_post();
                ?>
							<!-- BEGIN .activity-item -->
							<div class="activity-item <?php 
                if ($counter == $count) {
                    echo "last";
                }
                ?>
">
								<div class="image">
								<?php 
                $image = get_post_thumb($the_query->post->ID, 60, 60);
                ?>
									<a href="<?php 
                the_permalink();
                ?>
"><img src="<?php 
                if ($image['src']) {
                    echo $image['src'];
                }
                ?>
" alt="<?php 
                the_title();
                ?>
" width="60" height="60" /></a>
								</div>
								<div class="text">
									<h5><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h5>
									<p><a href="<?php 
                the_permalink();
                ?>
" class="more-link"><?php 
                printf(__('Read more', 'bordeaux'));
                ?>
</a></p>
								</div>
							<!-- END .activity-item -->
							</div>

							<?php 
                $counter++;
                ?>
							<?php 
            }
        } else {
            ?>
							<p><?php 
            printf(__('No posts where found', 'bordeaux'));
            ?>
</p>
							<?php 
        }
        ?>
					<!-- END .latest-activity -->
					</div>
					<div class="latest-activity" id="bordeaux_triple_recent_<?php 
        echo $widget_id;
        ?>
" style="display: none;">
							<?php 
        $args = array('posts_per_page' => $count);
        $the_query = new WP_Query($args);
        ?>
							<?php 
        $counter = 1;
        ?>
							<?php 
        if ($the_query->have_posts()) {
            while ($the_query->have_posts()) {
                $the_query->the_post();
                ?>
							<!-- BEGIN .activity-item -->
							<div class="activity-item <?php 
                if ($counter == $count) {
                    echo "last";
                }
                ?>
">
								<div class="image">
								<?php 
                $image = get_post_thumb($the_query->post->ID, 60, 60);
                ?>
									<a href="<?php 
                the_permalink();
                ?>
"><img src="<?php 
                if ($image['src']) {
                    echo $image['src'];
                }
                ?>
" alt="<?php 
                the_title();
                ?>
" width="60" height="60" /></a>
								</div>
								<div class="text">
									<h5><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h5>
									<p><a href="<?php 
                the_permalink();
                ?>
" class="more-link"><?php 
                printf(__('Read more', 'bordeaux'));
                ?>
</a></p>
								</div>
							<!-- END .activity-item -->
							</div>
							<?php 
                $counter++;
                ?>
							<?php 
            }
        } else {
            ?>
							<p><?php 
            printf(__('No posts where found', 'bordeaux'));
            ?>
</p>
							<?php 
        }
        ?>
					<!-- END .latest-activity -->
					</div>
					<div class="latest-activity" id="bordeaux_triple_comments_<?php 
        echo $widget_id;
        ?>
" style="display: none;">
							<?php 
        $comments = get_comments(array('number' => $count, 'status' => 'approve'));
        foreach ($comments as $c) {
            $ids[] = $c->comment_post_ID;
        }
        $args = array('post__in' => $ids, 'posts_per_page' => $count);
        $the_query = new WP_Query($args);
        ?>
							<?php 
        $counter = 1;
        ?>
							<?php 
        if ($the_query->have_posts()) {
            while ($the_query->have_posts()) {
                $the_query->the_post();
                ?>
							<!-- BEGIN .activity-item -->
							<div class="activity-item <?php 
                if ($counter == $count) {
                    echo "last";
                }
                ?>
">
								<div class="image">
								<?php 
                $image = get_post_thumb($the_query->post->ID, 60, 60);
                ?>
									<a href="<?php 
                the_permalink();
                ?>
"><img src="<?php 
                if ($image['src']) {
                    echo $image['src'];
                }
                ?>
" alt="<?php 
                the_title();
                ?>
" width="60" height="60" /></a>
								</div>
								<div class="text">
									<h5><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h5>
									<p><a href="<?php 
                the_permalink();
                ?>
" class="more-link"><?php 
                printf(__('Read more', 'bordeaux'));
                ?>
</a></p>
								</div>
							<!-- END .activity-item -->
							</div>
							<?php 
                $counter++;
                ?>
							<?php 
            }
        } else {
            ?>
							<p><?php 
            printf(__('No posts where found', 'bordeaux'));
            ?>
</p>
							<?php 
        }
        ?>
					<!-- END .latest-activity -->
					</div>
					
					
				<!-- END .sidebar-block-1 -->
				<?php 
        echo $after_widget;
        ?>

        <?php 
    }
示例#17
0
function ot_menu_card_query($categories)
{
    global $woocommerce;
    add_filter('excerpt_length', 'new_excerpt_length_16');
    $postContents = array();
    $c = 0;
    $catCount = 0;
    $postInPage = 0;
    $catOld = null;
    if (!empty($categories)) {
        foreach ($categories as $cat) {
            if (!is_page_template('template-homepage.php')) {
                $cat = $cat->term_id;
            }
            $query_args = array('posts_per_page' => -1, 'post_status' => 'publish', 'post_type' => 'product', 'tax_query' => array(array('taxonomy' => 'product_cat', 'field' => 'id', 'terms' => $cat)), 'meta_query' => array(array('key' => THEME_NAME . '_menu', 'value' => 'yes')));
            $query_args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
            $query_args['meta_query'] = array_filter($query_args['meta_query']);
            $r = new WP_Query($query_args);
            $cc = 0;
            if ($r->have_posts()) {
                $catNew = get_term_by('id', $cat, "product_cat");
                $catNew = $catNew->name;
                if ($catNew != $catOld) {
                    $catCount++;
                }
                while ($r->have_posts()) {
                    $r->the_post();
                    global $product;
                    $postInPage++;
                    $postContents[$c][$cc]["item_count"] = $r->post_count;
                    $postContents[$c][$cc]["cat_name"] = $catNew;
                    $postContents[$c][$cc]["item_title"] = get_the_title();
                    $postContents[$c][$cc]["item_permalink"] = get_permalink();
                    $postContents[$c][$cc]["item_excerpt"] = get_the_excerpt();
                    $postContents[$c][$cc]["item_price"] = $product->get_price_html();
                    $image = get_post_thumb($r->post->ID, 105, 105);
                    $postContents[$c][$cc]["item_image"] = $image['src'];
                    if (!$product->is_in_stock()) {
                        $postContents[$c][$cc]["item_button"] = '<a href="' . apply_filters("out_of_stock_add_to_cart_url", get_permalink($product->id)) . '" class="button product-button"><span class="icon-text">&#9656;</span>' . apply_filters("out_of_stock_add_to_cart_text", __("Read More", THEME_NAME)) . '</a>';
                    } else {
                        $link = array('url' => '', 'label' => '', 'class' => '', 'icon' => '');
                        $handler = apply_filters('woocommerce_add_to_cart_handler', $product->product_type, $product);
                        switch ($handler) {
                            case "variable":
                                $link['url'] = apply_filters('variable_add_to_cart_url', get_permalink($product->id));
                                $link['label'] = apply_filters('variable_add_to_cart_text', __('Select options', 'woocommerce'));
                                $link['icon'] = '&#9881;';
                                break;
                            case "grouped":
                                $link['url'] = apply_filters('grouped_add_to_cart_url', get_permalink($product->id));
                                $link['label'] = apply_filters('grouped_add_to_cart_text', __('View options', 'woocommerce'));
                                $link['icon'] = '&#9881;';
                                break;
                            case "external":
                                $link['url'] = apply_filters('external_add_to_cart_url', get_permalink($product->id));
                                $link['label'] = apply_filters('external_add_to_cart_text', __('Read More', 'woocommerce'));
                                $link['icon'] = '&#9656;';
                                break;
                            default:
                                if ($product->is_purchasable()) {
                                    $link['url'] = apply_filters('add_to_cart_url', esc_url($product->add_to_cart_url()));
                                    $link['label'] = apply_filters('add_to_cart_text', __('Add to cart', 'woocommerce'));
                                    $link['class'] = apply_filters('add_to_cart_class', 'add_to_cart_button');
                                    $link['icon'] = '&#59197;';
                                } else {
                                    $link['url'] = apply_filters('not_purchasable_url', get_permalink($product->id));
                                    $link['label'] = apply_filters('not_purchasable_text', __('Read More', 'woocommerce'));
                                    $link['icon'] = '&#9656;';
                                }
                                break;
                        }
                        $postContents[$c][$cc]["item_button"] = apply_filters('woocommerce_loop_add_to_cart_link', sprintf('<a href="%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" class="%s button product_type_%s product-button"><span class="icon-text">%s</span>%s</a>', esc_url($link['url']), esc_attr($product->id), esc_attr($product->get_sku()), esc_attr($link['class']), esc_attr($product->product_type), $link['icon'], esc_html($link['label'])), $product, $link);
                        $catOld = $catNew;
                    }
                    $cc++;
                }
                $c++;
            }
        }
    }
    remove_filter('excerpt_length', 'new_excerpt_length_16');
    return array('postContents' => $postContents, 'catCount' => $catCount, 'postInPage' => $postInPage);
}
示例#18
0
文件: slider.php 项目: bangjojo/wp
					<?php 
$args = array('numberposts' => 35, 'offset' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'meta_key' => 'bordeaux_slider', 'meta_value' => '1', 'post_type' => 'menu-card', 'post_status' => 'publish');
$myposts = get_posts($args);
$count = -1;
global $post;
foreach ($myposts as $post) {
    setup_postdata($post);
    $count++;
    $thePostID = $post->ID;
    $price = get_post_meta($thePostID, 'bordeaux_price', true);
    $boderaux_currency = get_option('boderaux_currency_category');
    if (!$price) {
        $price = 0;
    }
    $image = get_post_thumb($thePostID, 70, 70, "menu_slider");
    $image_big = get_post_thumb($thePostID, 180, 180, "menu_slider");
    if ($count >= 7) {
        echo "\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"slider-item\">";
        $count = 0;
    }
    $slider_hover = get_option('bordeaux_slider_image_hover');
    ?>
					
					
						<div class="item">
							<span class="price"><?php 
    echo $boderaux_currency;
    ?>
 <?php 
    echo $price;
    ?>
示例#19
0
    function woo_dealslinks_rehub()
    {
        ?>
<div class="deals_woo_rehub">
	<?php 
        $deal_title = vp_metabox('rehub_framework_woo.rehub_deals_title') ? vp_metabox('rehub_framework_woo.rehub_deals_title') : __('Choose your deal', 'rehub_framework');
        $rehub_woo_post_ids = vp_metabox('rehub_framework_woo.review_woo_list_links');
        if (!empty($rehub_woo_post_ids) && !is_array($rehub_woo_post_ids)) {
            $rehub_woo_post_ids = explode(',', $rehub_woo_post_ids);
        }
        $rehub_aff_post_ids = vp_metabox('rehub_framework_woo.review_woo_links');
        ?>
	<div class="title_deal_wrap"><div class="title_deal"><?php 
        echo esc_html($deal_title);
        ?>
</div></div>
	<?php 
        if (!empty($rehub_woo_post_ids)) {
            ?>
		<div class="wooaff_offer_links">
		<?php 
            $args = array('post__in' => $rehub_woo_post_ids, 'numberposts' => '-1', 'orderby' => 'post__in', 'post_type' => 'product', 'ignore_sticky_posts' => 1);
            global $post;
            global $woocommerce;
            $backup = $post;
            ?>
        <?php 
            $i = 1;
            $wp_query = new WP_Query($args);
            if ($wp_query->have_posts()) {
                ?>
                      
		<?php 
                while ($wp_query->have_posts()) {
                    $wp_query->the_post();
                    global $product;
                    ?>
		<?php 
                    $woolink = $product->product_type == 'external' ? $product->add_to_cart_url() : get_post_permalink(get_the_ID());
                    ?>
		<?php 
                    $term_ids = wp_get_post_terms(get_the_ID(), 'product_tag', array("fields" => "ids"));
                    if (!empty($term_ids)) {
                        $term_brand = $term_ids[0];
                        $term_brand_image = get_option("taxonomy_term_{$term_ids['0']}");
                    } else {
                        $term_brand_image = '';
                    }
                    $woo_img = get_post_thumb();
                    ?>
   
			<div class="woorow_aff">
				<div class="product-pic-wrapper">
					<a href="<?php 
                    echo $woolink;
                    ?>
" target="_blank"<?php 
                    if ($product->product_type == 'external') {
                        echo ' rel="nofollow"';
                    }
                    ?>
>
						<?php 
                    if (!empty($woo_img)) {
                        ?>
	
	            			<img src="<?php 
                        $params = array('width' => 100, 'height' => 100);
                        echo bfi_thumb($woo_img, $params);
                        ?>
" alt="<?php 
                        the_title_attribute();
                        ?>
" />
	            		<?php 
                    } elseif (!empty($term_brand_image['brand_image'])) {
                        ?>
	            			<img src="<?php 
                        $params = array('width' => 100, 'height' => 100);
                        echo bfi_thumb($term_brand_image['brand_image'], $params);
                        ?>
" alt="<?php 
                        the_title_attribute();
                        ?>
" />
	            		<?php 
                    } else {
                        ?>
	            			<img src="<?php 
                        echo get_template_directory_uri();
                        ?>
/images/default/noimage_100_70.png" alt="<?php 
                        the_title_attribute();
                        ?>
" />
	            		<?php 
                    }
                    ?>
	            	</a>				
				</div>
				<div class="product-details">
					<div class="product-name">
						<div class="aff_name"><a href="<?php 
                    echo $woolink;
                    ?>
" target="_blank"<?php 
                    if ($product->product_type == 'external') {
                        echo ' rel="nofollow"';
                    }
                    ?>
><?php 
                    the_title();
                    ?>
</a></div>
						<p><?php 
                    kama_excerpt('maxchar=150');
                    ?>
</p>
					</div>
					<div class="left_data_aff">
						<div class="wooprice_count">
						<?php 
                    if ($product->get_price() != '') {
                        ?>
							<?php 
                        echo $product->get_price_html();
                        ?>
						<?php 
                    }
                    ?>
	
						</div>					
						<div class="wooaff_tag">
				            <?php 
                    if (!empty($term_brand_image['brand_image'])) {
                        ?>
				            	<img src="<?php 
                        $params = array('width' => 100, 'height' => 100);
                        echo bfi_thumb($term_brand_image['brand_image'], $params);
                        ?>
" alt="<?php 
                        the_title_attribute();
                        ?>
" />
				            <?php 
                    } elseif (!empty($term_list[0])) {
                        ?>
 
				            	<?php 
                        echo $term_list[0];
                        ?>
				            <?php 
                    }
                    ?>
 							
						</div>
					</div>					
					<div class="woobuy_butt">
                    <?php 
                    if ($product->is_in_stock() && $product->add_to_cart_url() != '') {
                        ?>
                        <?php 
                        echo apply_filters('woocommerce_loop_add_to_cart_link', sprintf('<a href="%s" data-product_id="%s" data-product_sku="%s" class="woobtn_offer_block %s product_type_%s"%s%s>%s</a>', esc_url($product->add_to_cart_url()), esc_attr($product->id), esc_attr($product->get_sku()), $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : 'add_to_cart_button', esc_attr($product->product_type), $product->product_type == 'external' ? ' target="_blank"' : '', $product->product_type == 'external' ? ' rel="nofollow"' : '', $product->add_to_cart_text() ? esc_html($product->add_to_cart_text()) : __('See it', 'rehub_framework')), $product);
                        ?>
                    <?php 
                    }
                    ?>
					</div>
				</div>
			</div>
			<?php 
                }
            }
            wp_reset_postdata();
            $post = $backup;
            ?>
 
		</div>

	<?php 
        }
        ?>
	<?php 
        if (function_exists('thirstyInit') && !empty($rehub_aff_post_ids)) {
            ?>
		<div class="wooaff_offer_links">
		<?php 
            $rehub_aff_posts = get_posts(array('post_type' => 'thirstylink', 'post__in' => $rehub_aff_post_ids, 'meta_key' => 'rehub_aff_sticky', 'orderby' => 'meta_value', 'order' => 'DESC', 'numberposts' => '-1'));
            foreach ($rehub_aff_posts as $aff_post) {
                ?>
	
			<?php 
                $attachments = get_posts(array('post_type' => 'attachment', 'post_mime_type' => 'image', 'posts_per_page' => -1, 'post_parent' => $aff_post->ID));
                if (!empty($attachments)) {
                    $aff_thumb_list = wp_get_attachment_url($attachments[0]->ID);
                } else {
                    $aff_thumb_list = '';
                }
                $term_list = wp_get_post_terms($aff_post->ID, 'thirstylink-category', array("fields" => "names"));
                $term_ids = wp_get_post_terms($aff_post->ID, 'thirstylink-category', array("fields" => "ids"));
                if (!empty($term_ids)) {
                    $term_brand = $term_ids[0];
                    $term_brand_image = get_option("taxonomy_term_{$term_ids['0']}");
                } else {
                    $term_brand_image = '';
                }
                ?>
			<div class="woorow_aff">
				<div class="product-pic-wrapper">
					<a href="<?php 
                echo get_post_permalink($aff_post);
                ?>
">
						<?php 
                if (!empty($aff_thumb_list)) {
                    ?>
	
	            			<img src="<?php 
                    $params = array('width' => 100, 'height' => 100);
                    echo bfi_thumb($aff_thumb_list, $params);
                    ?>
" alt="<?php 
                    echo $aff_post->post_title;
                    ?>
" />
	            		<?php 
                } elseif (!empty($term_brand_image['brand_image'])) {
                    ?>
	            			<img src="<?php 
                    $params = array('width' => 100, 'height' => 100);
                    echo bfi_thumb($term_brand_image['brand_image'], $params);
                    ?>
" alt="<?php 
                    echo $aff_post->post_title;
                    ?>
" />
	            		<?php 
                } else {
                    ?>
	            			<img src="<?php 
                    echo get_template_directory_uri();
                    ?>
/images/default/noimage_100_70.png" alt="<?php 
                    echo $aff_post->post_title;
                    ?>
" />
	            		<?php 
                }
                ?>
	            	</a>				
				</div>
				<div class="product-details">
					<div class="product-name">
						<div class="aff_name"><a href="<?php 
                echo get_post_permalink($aff_post);
                ?>
"><?php 
                echo $aff_post->post_title;
                ?>
</a></div>
						<p><?php 
                echo get_post_meta($aff_post->ID, 'rehub_aff_desc', true);
                ?>
</p>
					</div>
					<div class="left_data_aff">
						<div class="wooprice_count">
							<?php 
                $product_price = get_post_meta($aff_post->ID, 'rehub_aff_price', true);
                ?>
							<?php 
                echo $product_price;
                ?>
						</div>					
						<div class="wooaff_tag">
				            <?php 
                if (!empty($term_brand_image['brand_image'])) {
                    ?>
				            	<img src="<?php 
                    $params = array('width' => 100, 'height' => 100);
                    echo bfi_thumb($term_brand_image['brand_image'], $params);
                    ?>
" alt="<?php 
                    the_title_attribute();
                    ?>
" />
				            <?php 
                } elseif (!empty($term_list[0])) {
                    ?>
 
				            	<?php 
                    echo $term_list[0];
                    ?>
				            <?php 
                }
                ?>
 							
						</div>
					</div>	
					<?php 
                $offer_btn_text = get_post_meta($aff_post->ID, 'rehub_aff_btn_text', true);
                ?>
				
					<div class="woobuy_butt">
						<a class="woobtn_offer_block" href="<?php 
                echo get_post_permalink($aff_post);
                ?>
" target="_blank" rel="nofollow"><?php 
                if ($offer_btn_text != '') {
                    echo $offer_btn_text;
                } elseif (rehub_option('rehub_btn_text') != '') {
                    echo rehub_option('rehub_btn_text');
                } else {
                    _e('See it', 'rehub_framework');
                }
                ?>
</a>
					</div>
				</div>
			</div>	
		<?php 
            }
            ?>
		</div>
	<?php 
        }
        ?>
</div>
<?php 
    }
示例#20
0
    exit;
}
// Exit if accessed directly
$gallery_style = get_post_meta($post->ID, THEME_NAME . "_gallery_style", true);
//gallery images
$galleryImages = get_post_meta($post->ID, THEME_NAME . "_gallery_images", true);
$imageIDs = explode(",", $galleryImages);
//set image urls
$c = 1;
$images = array();
foreach ($imageIDs as $id) {
    if ($id) {
        $file = wp_get_attachment_url($id);
        $images[$c] = get_post_thumb(false, 135, 135, false, $file);
    } else {
        $images[$c] = get_post_thumb($post->ID, 135, 135);
    }
    $c++;
}
$count = count($images);
?>

		<!-- BEGIN .index-item -->
		<div class="index-item" data-id="gallery-<?php 
the_ID();
?>
">
			<a href="<?php 
the_permalink();
?>
" class="<?php 
function the_post_thumb($size = 'post-thumbnail', $default = false, $alt = false, $width = false, $height = false, $attrs = false)
{
    echo get_post_thumb($size, $default, $alt, $width, $height, $attrs);
}
示例#22
0
    function print_slide_order($value)
    {
        if (isset($value['std'])) {
            $default = $value['std'];
        } else {
            $default = false;
        }
        if (isset($value['protected'][0]["id"])) {
            $protectedValue = $value['protected'][0]["id"];
        } else {
            $protectedValue = false;
        }
        $protected_value = $this->get_field_value($protectedValue, $default);
        if (isset($value['protected'][0]["id"]) && $value['protected'][0]["id"] != "" && $protected_value == $value['protected'][0]["value"] || !isset($value['protected'][0]["id"])) {
            if (get_option(THEME_NAME . "-slide-order-set") != "1") {
                $order = "";
            } else {
                $order = "&orderby=menu_order&order=ASC";
            }
            $cat = get_option($value['cat']);
            $count = $value['count'];
            $my_query = new WP_Query("cat=" . $cat . "&showposts=" . $count . $order);
            ?>
			<ul class="blocks block-active slider-sequence clearfix">
				<?php 
            if ($my_query->have_posts()) {
                while ($my_query->have_posts()) {
                    $my_query->the_post();
                    global $post;
                    $thePostID = $post->ID;
                    $image = get_post_thumb($thePostID, 45, 45, THEME_NAME . "_slider_image");
                    ?>
					<li class="row-item-full-width clearfix" id="recordsArray_<?php 
                    echo $post->ID;
                    ?>
">
						<div class="blocks-content clearfix">
							<div class="image"><img src="<?php 
                    echo $image['src'];
                    ?>
" alt="<?php 
                    get_the_title();
                    ?>
" /></div>
							<div class="text-content">
								<p><b><?php 
                    echo get_the_title();
                    ?>
</b></p>
								<p><?php 
                    echo get_the_excerpt();
                    ?>
</p>
							</div>
						</div>
					</li>
				<?php 
                }
            } else {
            }
            ?>
			</ul>
			<?php 
        }
    }
?>
" title="<?php 
echo esc_attr(sprintf(__('Permalink to %s', 'presence'), the_title_attribute('echo=0')));
?>
" rel="bookmark"><?php 
the_title();
?>
</a></h2>
				<div class="text">
					<?php 
$presence_values = get_option('presence_framework_values');
if (!is_array($presence_values)) {
    $presence_values = array();
}
if (array_key_exists('general_summary', $presence_values) && $presence_values['general_summary'] == 'on') {
    $img = get_post_thumb('false');
    if (!empty($img)) {
        if (!empty($img)) {
            echo '<p style="text-align:center;"><a href="' . $img . '" class="phzoom" title="';
            echo the_title();
            echo '"><img src="' . $img . '" alt="';
            echo the_title();
            echo '" /></a></p>';
        }
    }
    if (array_key_exists('text_length', $presence_values) && !empty($presence_values['text_length'])) {
        $strlen = intval($presence_values['text_length']);
    } else {
        $strlen = 350;
    }
    echo '<p>' . mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, $strlen, "&nbsp;[...]") . '</p>';
示例#24
0
    function wpsm_toptable_shortcode($atts, $content = null)
    {
        extract(shortcode_atts(array('id' => '', 'full_width' => '0'), $atts));
        if (isset($atts['id']) && $atts['id']) {
            $toppost = get_post($atts['id']);
            $module_cats = get_post_meta($toppost->ID, 'top_review_cat', true);
            $module_tag = get_post_meta($toppost->ID, 'top_review_tag', true);
            $module_fetch = intval(get_post_meta($toppost->ID, 'top_review_fetch', true));
            $module_ids = get_post_meta($toppost->ID, 'manual_ids', true);
            $order_choose = get_post_meta($toppost->ID, 'top_review_choose', true);
            $module_field_sorting = get_post_meta($toppost->ID, 'top_review_field_sort', true);
            $module_order = get_post_meta($toppost->ID, 'top_review_order', true);
            $first_column_enable = get_post_meta($toppost->ID, 'first_column_enable', true);
            $first_column_rank = get_post_meta($toppost->ID, 'first_column_rank', true);
            $last_column_enable = get_post_meta($toppost->ID, 'last_column_enable', true);
            $first_column_name = get_post_meta($toppost->ID, 'first_column_name', true) != '' ? esc_html(get_post_meta($toppost->ID, 'first_column_name', true)) : __('Product', 'rehub_framework');
            $last_column_name = get_post_meta($toppost->ID, 'last_column_name', true) != '' ? esc_html(get_post_meta($toppost->ID, 'last_column_name', true)) : '';
            $affiliate_link = get_post_meta($toppost->ID, 'first_column_link', true);
            $rows = get_post_meta($toppost->ID, 'columncontents', true);
            //Get the rows
            if ($module_fetch == '') {
                $module_fetch = '10';
            }
            ob_start();
            ?>
        <div class="clearfix"></div>
        <?php 
            if ($order_choose == 'cat_choose') {
                ?>
            <?php 
                $query = array('cat' => $module_cats, 'tag' => $module_tag, 'posts_per_page' => $module_fetch, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1);
                ?>
 
            <?php 
                if (!empty($module_field_sorting)) {
                    $query['meta_key'] = $module_field_sorting;
                    $query['orderby'] = 'meta_value_num';
                }
                ?>
            <?php 
                if ($module_order == 'asc') {
                    $query['order'] = 'ASC';
                }
                ?>
	                
    	<?php 
            } elseif ($order_choose == 'manual_choose' && $module_ids != '') {
                ?>
            <?php 
                $query = array('post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => -1, 'orderby' => 'post__in', 'post__in' => $module_ids);
                ?>
    	<?php 
            } else {
                ?>
            <?php 
                $query = array('posts_per_page' => $module_fetch, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1);
                ?>
            <?php 
                if (!empty($module_field_sorting)) {
                    $query['meta_key'] = $module_field_sorting;
                    $query['orderby'] = 'meta_value_num';
                }
                ?>
            <?php 
                if ($module_order == 'asc') {
                    $query['order'] = 'ASC';
                }
                ?>
	                             		
    	<?php 
            }
            ?>
	


        <?php 
            $loop = new WP_Query($query);
            $i = 0;
            if ($loop->have_posts()) {
                ?>
        <?php 
                wp_enqueue_script('tablesorter');
                wp_enqueue_style('tabletoggle');
                ?>
        <div class="scrollable_table">
        <table data-tablesaw-mode="columntoggle" data-tablesaw-minimap class="tablesaw top_table_block<?php 
                if ($full_width == '1') {
                    ?>
 full_width_rating<?php 
                } else {
                    ?>
 with_sidebar_rating<?php 
                }
                ?>
 tablesorter" cellspacing="0">
            <thead> 
            <tr class="top_rating_heading">
                <?php 
                if ($first_column_enable) {
                    ?>
<th class="product_col_name" data-tablesaw-sortable-col data-tablesaw-priority="persist"><?php 
                    echo $first_column_name;
                    ?>
</th><?php 
                }
                ?>
                <?php 
                if (!empty($rows)) {
                    $nameid = 0;
                    foreach ($rows as $row) {
                        $col_name = $row['column_name'];
                        echo '<th class="col_name" data-tablesaw-sortable-col data-tablesaw-priority="1">' . esc_html($col_name) . '</th>';
                        $nameid++;
                    }
                }
                ?>
                <?php 
                if ($last_column_enable) {
                    ?>
<th class="buttons_col_name" data-tablesaw-sortable-col data-tablesaw-priority="1"><?php 
                    echo $last_column_name;
                    ?>
</th><?php 
                }
                ?>
                      
            </tr>
            </thead>
            <tbody>
        <?php 
                while ($loop->have_posts()) {
                    $loop->the_post();
                    $i++;
                    ?>
     
            <tr class="top_rating_item" id='rank_<?php 
                    echo $i;
                    ?>
'>
                <?php 
                    if ($first_column_enable) {
                        ?>
                    <td class="product_image_col">
                    	<?php 
                        if (vp_metabox('rehub_post_side.is_editor_choice') == '1') {
                            ?>
<div class="ed_choice_label"><img src="<?php 
                            echo get_template_directory_uri();
                            ?>
/images/editor_hor_badge.png" width="115" height="36" alt=""></div><?php 
                        }
                        ?>
                        <figure>
                            <?php 
                        if (!is_paged() && $first_column_rank) {
                            ?>
<span class="rank_count"><?php 
                            if ($i == '1') {
                                ?>
<i class="fa fa-trophy"></i><?php 
                            } else {
                                echo $i;
                            }
                            ?>
</span><?php 
                        }
                        ?>
                            <?php 
                        $link_on_thumb = $affiliate_link != '' ? rehub_create_affiliate_link() : get_the_permalink();
                        ?>
                            <?php 
                        $link_on_thumb_target = $affiliate_link != '' ? ' class="btn_offer_block"' : '';
                        ?>
                            <a href="<?php 
                        echo $link_on_thumb;
                        ?>
" target="_blank"<?php 
                        echo $link_on_thumb_target;
                        ?>
>
                            <?php 
                        $img = get_post_thumb();
                        $nothumb = get_template_directory_uri() . '/images/default/noimage_100_70.png';
                        if (rehub_option('aq_resize_crop') == '1') {
                            $params = array('width' => 100);
                        } else {
                            $params = array('width' => 100, 'height' => 100, 'crop' => true);
                        }
                        ?>
                            <?php 
                        if (!empty($img)) {
                            ?>
                                <img src="<?php 
                            echo bfi_thumb($img, $params);
                            ?>
" alt="<?php 
                            the_title_attribute();
                            ?>
" />
                            <?php 
                        } else {
                            ?>
    
                                <img src="<?php 
                            echo $nothumb;
                            ?>
" alt="<?php 
                            the_title_attribute();
                            ?>
" />
                            <?php 
                        }
                        ?>
                            </a>
                        </figure>
                    </td>
                <?php 
                    }
                    ?>
                <?php 
                    if (!empty($rows)) {
                        $pbid = 0;
                        foreach ($rows as $row) {
                            $centered = $row['column_center'] == '1' ? ' centered_content' : '';
                            echo '<td class="column_' . $pbid . ' column_content' . $centered . '">';
                            echo do_shortcode(wp_kses_post($row['column_html']));
                            $element = $row['column_type'];
                            if ($element == 'meta_value') {
                                include locate_template('inc/top/metacolumn.php');
                            } else {
                                if ($element == 'review_function') {
                                    include locate_template('inc/top/reviewcolumn.php');
                                } else {
                                    if ($element == 'user_review_function') {
                                        include locate_template('inc/top/userreviewcolumn.php');
                                    } else {
                                    }
                                }
                            }
                            echo '</td>';
                            $pbid++;
                        }
                    }
                    ?>
                <?php 
                    if ($last_column_enable) {
                        ?>
                    <td class="buttons_col">
                    	<?php 
                        rehub_create_btn('');
                        ?>
                                
                    </td>
                <?php 
                    }
                    ?>
            </tr>
        <?php 
                }
                ?>
	        </tbody>
	    </table>
	    </div>
        <?php 
            } else {
                _e('No posts for this criteria.', 'rehub_framework');
                ?>
        <?php 
            }
            ?>
        <?php 
            wp_reset_query();
            ?>

    	<?php 
            $output = ob_get_contents();
            ob_end_clean();
            return $output;
        }
    }
示例#25
0
 public static function thumb_src($img = '', $width = '', $height = '')
 {
     global $post;
     if (!$img) {
         $img = get_post_thumb();
     }
     if (!empty($img)) {
         return king_createLinkImage($img, $width . 'x' . $height . 'xc');
     }
 }
示例#26
0
function tie_thumb_src($size = 'tie-small')
{
    global $post;
    if (tie_get_option('timthumb')) {
        if ($size == 'tie-medium') {
            $width = 272;
            $height = 125;
        } elseif ($size == 'tie-large') {
            $width = 290;
            $height = 195;
        } elseif ($size == 'slider') {
            $width = 660;
            $height = 330;
        } elseif ($size == 'big-slider') {
            $width = 995;
            $height = 498;
        } else {
            $width = 55;
            $height = 55;
        }
        $img = get_post_thumb();
        if (!empty($img)) {
            return $img_src = get_template_directory_uri() . "/timthumb.php?src=" . $img . "&amp;h=" . $height . "&amp;w=" . $width . "amp;a=c";
        }
    } else {
        $image_id = get_post_thumbnail_id($post->ID);
        $image_url = wp_get_attachment_image_src($image_id, $size);
        return $image_url[0];
    }
}
        the_content();
        ?>
			</div>
		<?php 
    }
    ?>
	


		<div class="thumbnails the-thumbs">
    		<?php 
    $c = 1;
    foreach ($imageIDs as $id) {
        if ($id) {
            $file = wp_get_attachment_url($id);
            $image = get_post_thumb(false, 110, 110, false, $file);
            ?>
				<a href="javascript:;" rel="<?php 
            echo $c;
            ?>
" class="gal-thumbs<?php 
            if ($c == $i) {
                ?>
 active<?php 
            }
            ?>
" data-nr="<?php 
            echo $c;
            ?>
">
					<img src="<?php 
示例#28
0
											<div class="menu-display-1">
												<?php 
        $args = array('numberposts' => 6, 'offset' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'meta_key' => 'bordeaux_popular_offering', 'meta_value' => '1', 'post_type' => 'menu-card', 'post_status' => 'publish');
        $myposts = get_posts($args);
        $count = 0;
        global $post;
        foreach ($myposts as $post) {
            setup_postdata($post);
            $count++;
            $thePostID = $post->ID;
            $price = get_post_meta($thePostID, 'bordeaux_price', true);
            if (!$price) {
                $price = 0;
            }
            $boderaux_currency = get_option('boderaux_currency_category');
            $image = get_post_thumb($thePostID, 180, 120);
            ?>
												
												
												
												
												<div class="item">
													<h5><?php 
            the_title();
            ?>
</h5>
													<a href="<?php 
            the_permalink();
            ?>
" class="image">
														<span class="price"><?php 
示例#29
0
    function wpsm_thumb($size = 'small')
    {
        global $post;
        if ($size == 'medium_news') {
            $width = 370;
            $height = 220;
            $nothumb = get_template_directory_uri() . '/images/default/noimage_370_220.png';
        } elseif ($size == 'med_thumbs') {
            $width = 123;
            $height = 90;
            $nothumb = get_template_directory_uri() . '/images/default/noimage_123_90.png';
        } elseif ($size == 'feature_slider') {
            $width = 765;
            $height = 460;
            $nothumb = get_template_directory_uri() . '/images/default/noimage_765_460.jpg';
        } elseif ($size == 'video_big') {
            $width = 474;
            $height = 342;
            $nothumb = get_template_directory_uri() . '/images/default/noimage_474_342.png';
        } elseif ($size == 'video_narrow') {
            $width = 270;
            $height = 110;
            $nothumb = get_template_directory_uri() . '/images/default/noimage_270_110.png';
        } elseif ($size == 'news_big') {
            $width = 378;
            $height = 310;
            $nothumb = get_template_directory_uri() . '/images/default/noimage_378_310.png';
        } elseif ($size == 'grid_news') {
            $width = 336;
            $height = 220;
            $nothumb = get_template_directory_uri() . '/images/default/noimage_336_220.png';
        } else {
            $width = 123;
            $height = 90;
            $nothumb = get_template_directory_uri() . '/images/default/noimage_123_90.png';
        }
        if (rehub_option('aq_resize') == 1) {
            if (rehub_option('aq_resize_crop') == '1') {
                $params = array('width' => $width, 'quality' => '90');
            } else {
                $params = array('width' => $width, 'height' => $height, 'crop' => true, 'quality' => '90');
            }
            $img = get_post_thumb();
            if (!empty($img)) {
                ?>
			<img src="<?php 
                echo bfi_thumb($img, $params);
                ?>
" alt="<?php 
                the_title_attribute();
                ?>
" />
	    <?php 
            } elseif (vp_metabox('rehub_post.rehub_framework_post_type') == 'video' && vp_metabox('rehub_post.video_post.0.video_post_embed_url') != '') {
                ?>
	
	     	<?php 
                $img_video_url = vp_metabox('rehub_post.video_post.0.video_post_embed_url');
                $img_video = parse_video_url($img_video_url, 'hqthumb');
                ?>
	
        	<img src="<?php 
                echo $img_video;
                ?>
" alt="<?php 
                the_title_attribute();
                ?>
" />
        <?php 
            } else {
                ?>
			<img src="<?php 
                echo $nothumb;
                ?>
" alt="<?php 
                the_title_attribute();
                ?>
" />
		<?php 
            }
        } else {
            $image_id = get_post_thumbnail_id($post->ID);
            $image_url = wp_get_attachment_image($image_id, $size, false, array('alt' => get_the_title(), 'title' => get_the_title()));
            if (!empty($image_url)) {
                ?>
			<?php 
                echo $image_url;
                ?>
	    <?php 
            } elseif (vp_metabox('rehub_post.rehub_framework_post_type') == 'video' && vp_metabox('rehub_post.video_post.0.video_post_embed_url') != '') {
                ?>
	
	     	<?php 
                $img_video_url = vp_metabox('rehub_post.video_post.0.video_post_embed_url');
                $img_video = parse_video_url($img_video_url, 'hqthumb');
                ?>
	
        	<img src="<?php 
                echo $img_video;
                ?>
" alt="<?php 
                the_title_attribute();
                ?>
"/>
        <?php 
            } else {
                ?>
			<img src="<?php 
                echo $nothumb;
                ?>
" alt="<?php 
                the_title_attribute();
                ?>
" />
		<?php 
            }
        }
    }
                }
                $sub_cats = ot_category_order($order, $sub_cats);
                foreach ($sub_cats as $sub_cat) {
                    echo "<h4>{$sub_cat->name}</h4>";
                    //*** category description ***//
                    $scat_description = $sub_cat->description;
                    echo "<p>" . $scat_description . "<p>";
                    $terms = $sub_cat->term_id;
                    $args = array('post_type' => OT_POST_MENU, 'posts_per_page' => -1, 'tax_query' => array(array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => $terms)), 'orderby' => 'menu_order', 'order' => 'DESC');
                    $my_query = new WP_Query($args);
                    if ($my_query->have_posts()) {
                        while ($my_query->have_posts()) {
                            $my_query->the_post();
                            $thePostID = $post->ID;
                            $image = get_post_thumb($thePostID, 54, 54, "menu_item_slider");
                            $image_hover = get_post_thumb($thePostID, 180, 180, "menu_item_slider_hover");
                            $price = get_post_meta($thePostID, THEME_NAME . '_price', true);
                            $bordeaux_currency = get_option(THEME_NAME . '_currency_category');
                            ?>
							<div class="menu-card-item">
								<a href="<?php 
                            the_permalink();
                            ?>
" class="image tooltip" title="<?php 
                            echo $image_hover['src'];
                            ?>
">
									<img src="<?php 
                            echo $image['src'];
                            ?>
" alt="<?php