本文整理汇总了PHP中get_post_thumb函数的典型用法代码示例。如果您正苦于以下问题:PHP get_post_thumb函数的具体用法?PHP get_post_thumb怎么用?PHP get_post_thumb使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_post_thumb函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: caption_handler
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;
}
开发者ID:trantuanvn,项目名称:coffeeletsgo,代码行数:27,代码来源:caption.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']);
$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
示例3: widget
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
}
开发者ID:bangjojo,项目名称:wp,代码行数:55,代码来源:widget-bordeaux-gallery.php
示例4: gallery_handler
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;
}
开发者ID:trantuanvn,项目名称:coffeeletsgo,代码行数:52,代码来源:gallery-box.php
示例5: add_image_thumb_2
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;
}
}
开发者ID:bangjojo,项目名称:wp,代码行数:15,代码来源:thumbs.php
示例6: add_image_thumb
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;
}
}
开发者ID:trantuanvn,项目名称:coffeeletsgo,代码行数:15,代码来源:thumbs.php
示例7: ot_get_option
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
开发者ID:trantuanvn,项目名称:coffeeletsgo,代码行数:31,代码来源:image.php
示例8: OT_lightbox_gallery
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;
}
开发者ID:trantuanvn,项目名称:coffeeletsgo,代码行数:28,代码来源:ajax.php
示例9: get_option
<?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
开发者ID:trantuanvn,项目名称:coffeeletsgo,代码行数:31,代码来源:share.php
示例10: while
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
开发者ID:bangjojo,项目名称:wp,代码行数:31,代码来源:template-gallery.php
示例11: apply_filters
// 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
}
开发者ID:trantuanvn,项目名称:coffeeletsgo,代码行数:31,代码来源:product-thumbnails.php
示例12: the_permalink
?>
<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
开发者ID:rhondamoananui,项目名称:rehub,代码行数:31,代码来源:taxonomy-download_category.php
示例13: lo_get_thumb
/**
* 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 . '&h=' . $height . '&w=' . $width . '&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 . '&h=' . $height . '&w=' . $width . '&a=c" alt="' . get_the_title($post->ID) . '">';
}
}
开发者ID:frostfan,项目名称:Lost,代码行数:17,代码来源:functions.php
示例14: rehub_create_column
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
}
开发者ID:rhondamoananui,项目名称:rehub,代码行数:98,代码来源:functions.php
示例15: widget
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>
//.........这里部分代码省略.........
开发者ID:trantuanvn,项目名称:coffeeletsgo,代码行数:101,代码来源:widget-bordeaux-triple-box.php
示例16: widget
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();
?>
//.........这里部分代码省略.........
开发者ID:bangjojo,项目名称:wp,代码行数:101,代码来源:widget-bordeaux-triple-box.php
示例17: ot_menu_card_query
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">▸</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'] = '⚙';
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'] = '⚙';
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'] = '▸';
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'] = '';
} else {
$link['url'] = apply_filters('not_purchasable_url', get_permalink($product->id));
$link['label'] = apply_filters('not_purchasable_text', __('Read More', 'woocommerce'));
$link['icon'] = '▸';
}
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);
}
开发者ID:trantuanvn,项目名称:coffeeletsgo,代码行数:83,代码来源:other.php
示例18: array
<?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;
?>
开发者ID:bangjojo,项目名称:wp,代码行数:31,代码来源:slider.php
示例19: woo_dealslinks_rehub
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>
//.........这里部分代码省略.........
开发者ID:rhondamoananui,项目名称:rehub,代码行数:101,代码来源:woo_functions.php
示例20: get_post_meta
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) {
|
请发表评论