本文整理汇总了PHP中wpex_post_thumbnail函数的典型用法代码示例。如果您正苦于以下问题:PHP wpex_post_thumbnail函数的具体用法?PHP wpex_post_thumbnail怎么用?PHP wpex_post_thumbnail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpex_post_thumbnail函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wpex_permalink
/**
* Search entry thumbnail
*
* @package Total WordPress theme
* @subpackage Partials
* @version 3.3.0
*/
// Exit if accessed directly
if (!defined('ABSPATH')) {
exit;
}
// Return if there isn't any thumbnail defined
if (!has_post_thumbnail()) {
return;
}
?>
<div class="search-entry-thumb">
<a href="<?php
wpex_permalink();
?>
" title="<?php
wpex_esc_title();
?>
" class="search-entry-img-link">
<?php
wpex_post_thumbnail(apply_filters('wpex_search_thumbnail_args', array('size' => 'thumbnail', 'width' => '', 'height' => '', 'alt' => wpex_get_esc_title())));
?>
</a>
</div><!-- .search-entry-thumb -->
示例2: wpex_post_thumbnail
?>
<div id="post-media" class="<?php
if (!empty($bluerock_highlights3)) {
echo 'sold ';
}
?>
clr">
<?php
echo wpex_post_thumbnail(array('size' => 'portfolio-thumby', 'alt' => wpex_get_esc_title()));
?>
</div><!-- #post-media -->
<?php
}
?>
<h2 class="property-heading">
<?php
the_title();
?>
</h2><!-- .single-post-title -->
<div class="property-location">
示例3: subcategory_thumbnail
/**
* Change category thumbnail.
*
* @since 2.0.0
*/
public static function subcategory_thumbnail($category)
{
// Get attachment id
$attachment = get_woocommerce_term_meta($category->term_id, 'thumbnail_id', true);
// Return thumbnail if attachment is defined
if ($attachment) {
wpex_post_thumbnail(array('attachment' => $attachment, 'size' => 'shop_category', 'alt' => esc_attr($category->name)));
} else {
echo '<img src="' . wc_placeholder_img_src() . '" alt="' . esc_html__('Placeholder Image', 'total') . '" />';
}
}
示例4: wpex_post_thumbnail
<div class="<?php
echo $image_classes;
?>
" <?php
echo $image_style;
?>
>
<?php
}
?>
<?php
// Display image
wpex_post_thumbnail($image_args);
?>
<?php
// Close link
if (isset($a_href) && $a_href) {
?>
</a><!-- .vcex-feature-box-image -->
<?php
// Link not defined, close div
} else {
?>
</div><!-- .vcex-feature-box-image -->
示例5: wpex_post_thumbnail
"<?php
echo $url_target;
?>
>
<?php
}
?>
<?php
}
?>
<?php
// Display featured image
wpex_post_thumbnail(array('size' => $img_size, 'width' => $img_width, 'height' => $img_height, 'alt' => wpex_get_esc_title(), 'crop' => $img_crop, 'class' => 'vcex-blog-entry-img'));
?>
<?php
// Inner link overlay HTML
wpex_overlay('inside_link', $overlay_style, $atts);
?>
<?php
// Close link tag
if ('nowhere' != $thumb_link) {
echo '</a>';
}
?>
<?php
示例6: wpex_post_thumbnail
<?php
}
?>
<?php
}
?>
<?php
// Primary image
wpex_post_thumbnail(array('attachment' => $primary_image, 'size' => $img_size, 'crop' => $img_crop, 'width' => $img_width, 'height' => $img_height, 'class' => 'vcex-image-swap-primary', 'style' => $image_style));
?>
<?php
// Secondary image
wpex_post_thumbnail(array('attachment' => $secondary_image, 'size' => $img_size, 'crop' => $img_crop, 'width' => $img_width, 'height' => $img_height, 'class' => 'vcex-image-swap-secondary', 'style' => $image_style));
?>
<?php
if ($link) {
echo '</a>';
}
?>
</div><!-- .vcex-image-swap -->
<?php
if ($css) {
echo '</div><!-- .css-wrapper -->';
}
?>
示例7: foreach
</div><!-- .wpex-slider-slides -->
<?php
if ('true' == $control_thumbs) {
?>
<div class="sp-nc-thumbnails">
<?php
foreach ($posts_cache as $post_id) {
?>
<?php
// Output thumbnail image
wpex_post_thumbnail(array('attachment' => get_post_thumbnail_id($post_id), 'size' => $img_size, 'crop' => $img_crop, 'width' => $img_width, 'height' => $img_height, 'class' => 'sp-nc-thumbnail'));
?>
<?php
}
?>
</div><!-- .sp-nc-thumbnailss -->
<?php
}
?>
</div><!-- .wpex-slider -->
</div><!-- .vcex-testimonials-fullslider -->
示例8: elseif
<?php
} elseif (has_post_thumbnail($post->ID)) {
?>
<div class="vcex-news-entry-thumbnail clr">
<a href="<?php
echo $post->permalink;
?>
" title="<?php
wpex_esc_title();
?>
">
<?php
// Display thumbnail
wpex_post_thumbnail(array('size' => $img_size, 'crop' => $img_crop, 'width' => $img_width, 'height' => $img_height, 'alt' => wpex_get_esc_title()));
?>
</a>
</div><!-- .vcex-news-entry-thumbnail -->
<?php
}
?>
<?php
}
?>
<?php
if ('true' == $title) {
?>
示例9: wpex_post_thumbnail
</div><!-- .entry -->
</div><!-- .home-testimonial-entry-content-->
<div class="testimonial-entry-bottom">
<?php
// Check if post thumbnail is defined
if (has_post_thumbnail($testimonial->ID) && 'true' == $entry_media) {
?>
<div class="testimonial-entry-thumb">
<?php
// Display post thumbnail
wpex_post_thumbnail(array('attachment' => get_post_thumbnail_id($testimonial->ID), 'size' => $img_size, 'width' => $img_width, 'height' => $img_height, 'class' => $img_classes, 'style' => $img_style, 'crop' => $img_crop));
?>
</div><!-- /testimonial-thumb -->
<?php
}
?>
<div class="testimonial-entry-meta">
<?php
// Display testimonial author
if ('true' == $author && $testimonial->author) {
?>
示例10: wpex_post_thumbnail
?>
" title="<?php
echo $post->title_attribute;
?>
" class="<?php
echo $thumbnail_link_classes;
?>
">
<?php
}
?>
<?php
// Display post thumbnail
wpex_post_thumbnail(array('width' => $img_width, 'height' => $img_height, 'size' => $img_size, 'crop' => $img_crop, 'alt' => $post->title_attribute));
?>
<?php
// Inner link overlay html
wpex_overlay('inside_link', $overlay_style, $atts);
?>
<?php
if ('none' != $thumbnail_link) {
echo '</a>';
}
?>
<?php
// Outer link overlay HTML
示例11: esc_attr
" title="<?php
echo esc_attr($url_title);
?>
" class="<?php
echo $url_classes;
?>
"<?php
echo $url_target;
?>
>
<?php
}
?>
<?php
// Display image
wpex_post_thumbnail(array('attachment' => $image, 'size' => 'wpex_custom', 'width' => $img_width, 'height' => $img_height));
?>
<?php
if ($url) {
echo '</a>';
}
?>
</figure>
<?php
}
?>
<?php
// Content
if ($content || $heading) {
示例12: widget
/**
* Front-end display of widget.
*
* @see WP_Widget::widget()
*
* @param array $args Widget arguments.
* @param array $instance Saved values from database.
*/
public function widget($args, $instance)
{
// Parse instance
extract(wp_parse_args($instance, $this->defaults));
// Apply filters to the title
$title = isset($instance['title']) ? apply_filters('widget_title', $instance['title']) : '';
// Before widget WP hook
echo $args['before_widget'];
// Display title if defined
if ($title) {
echo $args['before_title'] . $title . $args['after_title'];
}
?>
<ul class="wpex-widget-recent-posts wpex-clr style-<?php
echo esc_attr($style);
?>
">
<?php
// Query args
$query_args = array('post_type' => $post_type, 'posts_per_page' => $number, 'meta_key' => '_thumbnail_id', 'no_found_rows' => true);
// Order params - needs FALLBACK don't ever edit!
if (!empty($orderby)) {
$query_args['order'] = $order;
$query_args['orderby'] = $orderby;
} else {
$query_args['orderby'] = $order;
// THIS IS THE FALLBACK
}
// Taxonomy args
if (!empty($taxonomy) && !empty($terms)) {
// Sanitize terms and convert to array
$terms = str_replace(', ', ',', $terms);
$terms = explode(',', $terms);
// Add to query arg
$query_args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'slug', 'terms' => $terms));
}
// Exclude current post
if (is_singular()) {
$query_args['post__not_in'] = array(get_the_ID());
}
// Query posts
$wpex_query = new WP_Query($query_args);
// If there are posts loop through them
if ($wpex_query->have_posts()) {
// Loop through posts
while ($wpex_query->have_posts()) {
$wpex_query->the_post();
?>
<?php
// Get hover classes
if ($img_hover) {
$hover_classes = ' ' . wpex_image_hover_classes($img_hover);
} else {
$hover_classes = '';
}
?>
<li class="wpex-widget-recent-posts-li clr">
<?php
if (has_post_thumbnail()) {
?>
<a href="<?php
wpex_permalink();
?>
" title="<?php
wpex_esc_title();
?>
" class="wpex-widget-recent-posts-thumbnail<?php
echo esc_attr($hover_classes);
?>
">
<?php
wpex_post_thumbnail(array('size' => $img_size, 'width' => $img_width, 'height' => $img_height, 'alt' => wpex_get_esc_title()));
?>
</a>
<?php
}
?>
<a href="<?php
wpex_permalink();
?>
" title="<?php
wpex_esc_title();
?>
" class="wpex-widget-recent-posts-title"><?php
the_title();
?>
//.........这里部分代码省略.........
示例13: vcex_html
" class="portfolio-entry-media-link"<?php
echo vcex_html('target_attr', $link_target);
?>
>
<?php
}
?>
<?php
}
?>
<?php
// Display post thumbnail
wpex_post_thumbnail(array('width' => $img_width, 'height' => $img_height, 'crop' => $img_crop, 'alt' => wpex_get_esc_title(), 'class' => 'portfolio-entry-img', 'size' => $img_size));
?>
<?php
// Inner link overlay HTML
wpex_overlay('inside_link', $overlay_style, $atts);
?>
<?php
// Close link tag
if ('nowhere' != $thumb_link) {
echo '</a>';
}
?>
<?php
示例14: wpex_post_thumbnail
</div><!-- .entry -->
</div><!-- .home-testimonial-entry-content-->
<div class="testimonial-entry-bottom">
<?php
// Check if post thumbnail is defined
if (has_post_thumbnail() && 'true' == $entry_media) {
?>
<div class="testimonial-entry-thumb">
<?php
// Display post thumbnail
wpex_post_thumbnail(array('size' => $img_size, 'width' => $img_width, 'height' => $img_height, 'class' => $img_classes, 'style' => $img_style, 'crop' => $img_crop));
?>
</div><!-- /testimonial-thumb -->
<?php
}
?>
<div class="testimonial-entry-meta">
<?php
// Display testimonial author
if ('true' == $author && $testimonial->author) {
?>
示例15: foreach
?>
</div><!-- .wpex-slider-slides -->
<div class="wpex-slider-thumbnails sp-thumbnails cols-<?php
echo $thumbnails_columns;
?>
">
<?php
foreach ($attachments as $attachment => $custom_link) {
?>
<?php
// Output thumbnail image
wpex_post_thumbnail(array('attachment' => $attachment, 'size' => 'wpex_custom', 'width' => $img_thumb_width, 'height' => $img_thumb_height, 'class' => 'wpex-slider-thumbnail sp-thumbnail'));
?>
<?php
}
?>
</div><!-- .wpex-slider-thumbnails -->
</div><!-- .wpex-slider -->
<?php
// Close css wrapper
if ($css) {
echo '</div>';
}