本文整理汇总了PHP中wpsm_thumb函数的典型用法代码示例。如果您正苦于以下问题:PHP wpsm_thumb函数的具体用法?PHP wpsm_thumb怎么用?PHP wpsm_thumb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpsm_thumb函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: widget
/**
* 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;
}
开发者ID:rhondamoananui,项目名称:rehub,代码行数:63,代码来源:imagegrid_sidebar.php
示例2: widget
/**
* 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']);
$query = array('showposts' => 1, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'meta_key' => 'rehub_framework_post_type', 'meta_value' => 'video');
$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;
}
?>
<?php
while ($loop->have_posts()) {
$loop->the_post();
?>
<figure>
<div class="pattern"></div>
<a class="fa fa-play-circle vid_icon" href="<?php
the_permalink();
?>
"></a><?php
wpsm_thumb('grid_news');
?>
</figure>
<h3><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h3>
<?php
}
?>
<?php
wp_reset_query();
?>
<?php
} else {
_e('No posts for this criteria.', 'rehub_framework');
?>
<?php
}
?>
<?php
/* After widget (defined by themes). */
echo $after_widget;
}
开发者ID:rhondamoananui,项目名称:rehub,代码行数:57,代码来源:latest_video.php
示例3: wpsm_thumb
?>
<div class="rehub_feat_block table_view_block"><a name="woo-link-list"></a>
<?php
if ($product->is_on_sale()) {
?>
<div class="vip_corner"><span class="vip_badge sale_badge">Sale!</span></div><?php
}
?>
<div class="block_with_coupon">
<div class="offer_thumb">
<a href="<?php
echo $woolink;
?>
" target="_blank"><?php
wpsm_thumb('med_thumbs');
?>
</a>
</div>
<div class="desc_col">
<div class="offer_title"><a href="<?php
echo $woolink;
?>
" target="_blank"><?php
the_title();
?>
</a></div>
<p>
<?php
kama_excerpt('maxchar=150');
?>
开发者ID:rhondamoananui,项目名称:rehub,代码行数:31,代码来源:index.php
示例4: WP_Query
$loop = new WP_Query($args);
if ($loop->have_posts()) {
?>
<?php
while ($loop->have_posts()) {
$loop->the_post();
?>
<div class="columns<?php
if ($i == '0') {
?>
col-1<?php
}
?>
">
<figure><?php
wpsm_thumb('grid_news');
?>
<span class="pattern"></span>
<div class="sidecol-overlay">
<?php
if (rehub_option('exclude_comments_meta') == 0) {
comments_popup_link(0, 1, '%', 'comment', '');
}
?>
<h3><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h3>
开发者ID:rhondamoananui,项目名称:rehub,代码行数:31,代码来源:wpsm_featured.php
示例5: the_permalink
if ($i % 4 == '1') {
?>
first-col<?php
}
?>
">
<?php
}
?>
<figure>
<a href="<?php
the_permalink();
?>
"><?php
wpsm_thumb('news_big');
?>
</a>
</figure>
<div class="content_constructor">
<h2><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h2>
<div class="rehub_catalog_desc">
<?php
kama_excerpt('maxchar=' . $exerpt_count . '');
?>
开发者ID:rhondamoananui,项目名称:rehub,代码行数:31,代码来源:columngrid_loop.php
示例6: widget
/**
* 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'];
$post_type = $instance['post_type'];
global $post;
if ($post_type == 'tags') {
$query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'tag' => $tags);
} elseif ($post_type == 'featured') {
$query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'meta_key' => 'is_featured', 'meta_value' => '1');
} else {
$query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'meta_key' => 'is_featured', 'meta_value' => '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;
}
?>
<?php
wp_enqueue_script('flexslider');
?>
<div class="slides">
<?php
while ($loop->have_posts()) {
$loop->the_post();
?>
<div class="slide">
<div class="wrap">
<a href="<?php
the_permalink();
?>
" class="view-link">
<span class="pattern"></span>
<div class="image"><?php
wpsm_thumb('grid_news');
?>
</div>
<?php
if (vp_metabox('rehub_post.rehub_framework_post_type') == 'review') {
?>
<span class="score"><i><?php
echo rehub_get_overall_score();
?>
</i><?php
_e('SCORE', 'rehub_framework');
?>
</span><?php
}
?>
<?php
$category = get_the_category($post->ID);
$first_cat = $category[0]->term_id;
$cat_name = get_cat_name($first_cat);
?>
<span class="reviews"><?php
echo $cat_name;
?>
</span>
</a>
<h3><a class="link" href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h3>
<p><?php
kama_excerpt('maxchar=100');
?>
</p>
</div>
</div>
<?php
}
?>
</div>
<?php
wp_reset_query();
?>
<?php
} else {
_e('No posts for this criteria.', 'rehub_framework');
?>
<?php
}
?>
<?php
/* After widget (defined by themes). */
//.........这里部分代码省略.........
开发者ID:rhondamoananui,项目名称:rehub,代码行数:101,代码来源:featured_sidebar.php
示例7: meta_all
meta_all(true, $first_cat, false);
?>
</div>
</div>
</div>
</figure>
</div>
<?php
} else {
?>
<div class="right">
<figure><span class="fa fa-play-circle vid_icon_min"></span><a href="<?php
the_permalink();
?>
"><?php
wpsm_thumb('video_narrow');
?>
</a></figure>
<h3><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h3>
<div class="post-meta"><?php
$category = get_the_category($post->ID);
$first_cat = $category[0]->term_id;
meta_all(true, $first_cat, false);
?>
</div>
开发者ID:rhondamoananui,项目名称:rehub,代码行数:31,代码来源:video-block.php
示例8: widget
/**
* How to display the widget on the screen.
*/
function widget($args, $instance)
{
extract($args);
if (is_singular('post')) {
/* Our variables from the widget settings. */
$title = apply_filters('widget_title', $instance['title']);
$number = $instance['number'];
global $post;
$category = get_the_category($post->ID);
$first_cat = $category[0]->term_id;
$query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $first_cat, 'meta_key' => 'rehub_review_overall_score', 'orderby' => 'meta_value_num', 'post__not_in' => array($post->ID), 'meta_query' => array(array('key' => 'rehub_framework_post_type', 'value' => 'review', 'compare' => 'LIKE')));
$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="tabs-item clearfix">
<?php
while ($loop->have_posts()) {
$loop->the_post();
?>
<div class="clearfix">
<figure><?php
wpsm_thumb('med_thumbs');
?>
<?php
rehub_formats_icons();
?>
</figure>
<div class="detail">
<h5><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h5>
<div class="rcnt_meta">
<?php
meta_small(false, false, true);
?>
</div>
<?php
rehub_format_score('small');
?>
</div>
</div>
<?php
}
?>
</div>
<?php
wp_reset_query();
?>
<?php
} else {
?>
<?php
}
?>
<?php
/* After widget (defined by themes). */
echo $after_widget;
}
}
开发者ID:rhondamoananui,项目名称:rehub,代码行数:74,代码来源:related_reviews.php
示例9: while
if ($fivenews->have_posts()) {
while ($fivenews->have_posts()) {
$fivenews->the_post();
$count++;
?>
<?php
if ($count == 1) {
?>
<div class="big_img">
<figure>
<div class="pattern"></div>
<a href="<?php
the_permalink();
?>
"><?php
wpsm_thumb('video_big');
?>
</a>
<div class="video_overlay">
<?php
if (rehub_option('exclude_comments_meta') == 0) {
comments_popup_link(0, 1, '%', 'comment', '');
}
?>
<?php
rehub_formats_icons();
?>
<div class="overlay_title">
<?php
echo $category_echo;
?>
开发者ID:rhondamoananui,项目名称:rehub,代码行数:31,代码来源:news_no_thumbs_mod.php
示例10: rehub_most_popular_widget_block
function rehub_most_popular_widget_block($basedby = 'hot', $sortby = '', $number = 5)
{
?>
<?php
if ($sortby == 'this_week') {
if (!function_exists('filter_where_week')) {
function filter_where_week($where = '')
{
//posts in the last 7 days
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-7 days')) . "'";
return $where;
}
}
add_filter('posts_where', 'filter_where_week');
} elseif ($sortby == 'this_month') {
if (!function_exists('filter_where_month')) {
function filter_where_month($where = '')
{
//posts in the last 30 days
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";
return $where;
}
}
add_filter('posts_where', 'filter_where_month');
} elseif ($sortby == 'three_month') {
if (!function_exists('filter_where_t_month')) {
function filter_where_t_month($where = '')
{
//posts in the last 30 days
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-90 days')) . "'";
return $where;
}
}
add_filter('posts_where', 'filter_where_t_month');
} else {
}
global $post;
if ($basedby == 'hot') {
$popular_posts = new WP_Query('showposts=' . $number . '&meta_key=post_hot_count&orderby=meta_value_num&order=DESC&ignore_sticky_posts=1');
} elseif ($basedby == 'views') {
$popular_posts = new WP_Query('showposts=' . $number . '&meta_key=rehub_views&orderby=meta_value_num&order=DESC&ignore_sticky_posts=1');
} else {
$popular_posts = new WP_Query('showposts=' . $number . '&orderby=comment_count&order=DESC&ignore_sticky_posts=1');
}
if ($popular_posts->have_posts()) {
?>
<?php
while ($popular_posts->have_posts()) {
$popular_posts->the_post();
?>
<div class="clearfix">
<figure><a href="<?php
the_permalink();
?>
"><?php
wpsm_thumb('med_thumbs');
?>
</a></figure>
<div class="detail">
<h5><?php
if ($basedby == 'hot') {
echo getHotLikeTitle(get_the_ID());
}
?>
<a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h5>
<div class="rcnt_meta">
<?php
$category = get_the_category($post->ID);
$first_cat = $category[0]->term_id;
?>
<?php
if ($basedby == 'views') {
meta_small(false, $first_cat, false, true);
} else {
meta_small(false, $first_cat, true, false);
}
?>
</div>
<?php
$quick_price = get_post_meta(get_the_ID(), 'rehub_offer_product_price', true);
$egg_price = get_post_meta(get_the_ID(), 'affegg_product_price', true);
if (!empty($quick_price)) {
echo '<span class="price_count">' . $quick_price . '</span>';
} elseif (!empty($egg_price)) {
$re_egg_currency = get_post_meta(get_the_ID(), 'affegg_product_currency', true);
$types = array("RUB" => "руб.", "UAH" => "грн.", "USD" => "\$", "CAD" => "\$", "GBP" => "£", "EUR" => "€", "JPY" => "¥", "CNY" => "¥", "INR" => "₹");
if (key_exists($re_egg_currency, $types)) {
$re_egg_currency = $types[$re_egg_currency];
}
echo '<span class="price_count">' . $re_egg_currency . $egg_price . '</span>';
}
//.........这里部分代码省略.........
开发者ID:rhondamoananui,项目名称:rehub,代码行数:101,代码来源:functions.php
示例11: WP_Query
?>
<section class="clearfix">
<!-- Feature Slider -->
<div class="flexslider main_slider s_for_sidebar loading">
<i class="fa fa-spinner fa-pulse"></i>
<ul class="slides">
<?php
$post_slider = new WP_Query(array('cat' => $module_cat, 'tag' => $module_tag, 'post_type' => 'post', 'showposts' => $module_fetch, 'ignore_sticky_posts' => 1));
?>
<?php
if ($post_slider->have_posts()) {
while ($post_slider->have_posts()) {
$post_slider->the_post();
?>
<li class="slide"> <?php
wpsm_thumb('feature_slider');
?>
<span class="pattern"></span>
<div class="flex-overlay">
<div class="post-meta">
<div class="inner_meta"><?php
$category = get_the_category(get_the_ID());
$first_cat = $category[0]->term_id;
meta_small(true, $first_cat, false);
?>
</div>
</div>
<h2><a href="<?php
the_permalink();
?>
"><?php
开发者ID:rhondamoananui,项目名称:rehub,代码行数:31,代码来源:post_slider_mod.php
示例12: rehub_top_offers_widget_block_woo
function rehub_top_offers_widget_block_woo($tags = '', $number = '5', $order = '')
{
?>
<?php
$args = array('showposts' => $number, 'product_tag' => $tags, 'ignore_sticky_posts' => '1', 'post_type' => 'product');
if (!empty($order)) {
$args['meta_key'] = $order;
$args['orderby'] = 'meta_value_num';
$args['order'] = 'DESC';
}
$offers = new WP_Query($args);
if ($offers->have_posts()) {
?>
<div class="tabs-item woocommerce">
<?php
while ($offers->have_posts()) {
$offers->the_post();
?>
<div class="clearfix">
<figure><a href="<?php
the_permalink();
?>
"><?php
wpsm_thumb('med_thumbs');
?>
</a></figure>
<div class="detail">
<h5><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h5>
<div class="mt10"><?php
do_action('woocommerce_after_shop_loop_item_title');
?>
</div>
</div>
</div>
<?php
}
}
wp_reset_postdata();
?>
</div>
<?php
}
开发者ID:rhondamoananui,项目名称:rehub,代码行数:54,代码来源:sidebar_functions.php
示例13: rehub_quick_offer
function rehub_quick_offer()
{
global $post;
?>
<?php
$offer_url = get_post_meta($post->ID, 'rehub_offer_product_url', true);
$offer_price = get_post_meta($post->ID, 'rehub_offer_product_price', true);
$offer_title = get_post_meta($post->ID, 'rehub_offer_name', true);
$offer_thumb = get_post_meta($post->ID, 'rehub_offer_product_thumb', true);
$offer_btn_text = get_post_meta($post->ID, 'rehub_offer_btn_text', true);
$offer_price_old = get_post_meta($post->ID, 'rehub_offer_product_price_old', true);
$offer_coupon = get_post_meta($post->ID, 'rehub_offer_product_coupon', true);
$offer_coupon_date = get_post_meta($post->ID, 'rehub_offer_coupon_date', true);
$offer_coupon_mask = get_post_meta($post->ID, 'rehub_offer_coupon_mask', true);
$offer_desc = get_post_meta($post->ID, 'rehub_offer_product_desc', true);
?>
<?php
$offer_price_clean = preg_replace("/[^0-9.]/", "", $offer_price);
update_post_meta(get_the_ID(), 'rehub_main_product_price', $offer_price_clean);
// save price of affiliate link to post meta
?>
<div class="rehub_feat_block table_view_block"><a name="quick-offer"></a>
<div class="block_with_coupon">
<div class="offer_thumb">
<a href="<?php
echo $offer_url;
?>
" target="_blank" rel="nofollow">
<?php
if (!empty($offer_thumb)) {
?>
<img src="<?php
$params = array('width' => 120, 'height' => 90);
echo bfi_thumb($offer_thumb, $params);
?>
" alt="<?php
the_title_attribute();
?>
" />
<?php
} else {
?>
<?php
wpsm_thumb('med_thumbs');
?>
<?php
}
?>
</a>
</div>
<div class="desc_col">
<div class="offer_title"><?php
echo esc_html($offer_title);
?>
</div>
<p><?php
echo wp_kses_post($offer_desc);
?>
</p>
</div>
<?php
if (!empty($offer_price)) {
?>
<div class="price_col">
<p><span class="price_count"><ins><?php
echo esc_html($offer_price);
?>
</ins><?php
if ($offer_price_old != '') {
?>
<del><?php
echo esc_html($offer_price_old);
?>
</del><?php
}
?>
</span></p>
</div>
<?php
}
?>
<div class="buttons_col">
<div class="priced_block clearfix">
<?php
if (!empty($offer_coupon_date)) {
?>
<?php
$timestamp1 = strtotime($offer_coupon_date);
$seconds = $timestamp1 - time();
$days = floor($seconds / 86400);
$seconds %= 86400;
if ($days > 0) {
$coupon_text = $days . ' ' . __('days left', 'rehub_framework');
$coupon_style = '';
} elseif ($days == 0) {
$coupon_text = __('Last day', 'rehub_framework');
$coupon_style = '';
} else {
$coupon_text = __('Coupon is Expired', 'rehub_framework');
$coupon_style = 'expired_coupon';
//.........这里部分代码省略.........
开发者ID:rhondamoananui,项目名称:rehub,代码行数:101,代码来源:review_functions.php
示例14: widget
/**
* 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']);
$categories = $instance['categories'];
$sortby = $instance['sortby'];
$number = $instance['number'];
$post_type = $instance['post_type'];
if (!empty($instance['dark'])) {
$color = 'dark';
} else {
$color = '';
}
if ($sortby == 'this_week') {
function filter_where($where = '')
{
//posts in the last 7 days
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-7 days')) . "'";
return $where;
}
add_filter('posts_where', 'filter_where');
} elseif ($sortby == 'this_month') {
function filter_where($where = '')
{
//posts in the last 30 days
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";
return $where;
}
add_filter('posts_where', 'filter_where');
} elseif ($sortby == 'three_month') {
function filter_where($where = '')
{
//posts in the last 30 days
$where .= " AND post_date > '" . date('Y-m-d', strtotime('-90 days')) . "'";
return $where;
}
add_filter('posts_where', 'filter_where');
}
if ($post_type == 'all') {
$query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories);
} elseif ($post_type == 'regular') {
$query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories, 'meta_key' => 'rehub_framework_post_type', 'meta_value' => 'regular');
} elseif ($post_type == 'video') {
$query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories, 'meta_key' => 'rehub_framework_post_type', 'meta_value' => 'video');
} elseif ($post_type == 'gallery') {
$query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories, 'meta_key' => 'rehub_framework_post_type', 'meta_value' => 'gallery');
} elseif ($post_type == 'review') {
$query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories, 'meta_key' => 'rehub_framework_post_type', 'meta_value' => 'review');
} elseif ($post_type == 'music') {
$query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories, 'meta_key' => 'rehub_framework_post_type', 'meta_value' => 'music');
} else {
$query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories);
}
if ($sortby == 'random') {
$query['orderby'] = 'rand';
}
global $post;
$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="color_sidebar<?php
if ($color == 'dark') {
?>
dark_sidebar<?php
}
?>
">
<div class="tabs-item clearfix">
<?php
while ($loop->have_posts()) {
$loop->the_post();
?>
<div class="clearfix">
<figure><a href="<?php
the_permalink();
?>
"><?php
wpsm_thumb('med_thumbs');
?>
</a></figure>
<div class="detail">
<h5><a href="<?php
the_permalink();
?>
"><?php
the_title();
?>
</a></h5>
<div class="rcnt_meta">
//.........这里部分代码省略.........
开发者ID:rhondamoananui,项目名称:rehub,代码行数:101,代码来源:posts_list.php
注:本文中的wpsm_thumb函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论