• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wpex_get_post_thumbnail函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中wpex_get_post_thumbnail函数的典型用法代码示例。如果您正苦于以下问题:PHP wpex_get_post_thumbnail函数的具体用法?PHP wpex_get_post_thumbnail怎么用?PHP wpex_get_post_thumbnail使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了wpex_get_post_thumbnail函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: wpex_get_portfolio_post_thumbnail

/**
 * Returns correct thumbnail HTML for the portfolio posts
 *
 * @since 2.0.0
 */
function wpex_get_portfolio_post_thumbnail($args = array())
{
    // Define thumbnail args
    $defaults = array('size' => 'portfolio_post', 'class' => 'portfolio-single-media-img', 'alt' => wpex_get_esc_title(), 'schema_markup' => true);
    // Parse arguments
    $args = wp_parse_args($args, $defaults);
    // Return thumbanil
    return wpex_get_post_thumbnail(apply_filters('wpex_get_portfolio_post_thumbnail_args', $args));
}
开发者ID:iq007,项目名称:MadScape,代码行数:14,代码来源:portfolio-helpers.php


示例2: apply_filters

<?php

/**
 * Single Custom Post Type Media
 *
 * @package Total WordPress theme
 * @subpackage Partials
 * @version 3.3.0
 */
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
// Thumbnail args
$args = apply_filters('wpex_' . get_post_type() . '_single_thumbnail_args', array('size' => 'full', 'alt' => wpex_get_esc_title(), 'schema_markup' => true));
// Get thumbnail
$thumbnail = wpex_get_post_thumbnail($args);
// Display featured image
if ($thumbnail) {
    ?>

	<div id="post-media" class="wpex-clr">
		<?php 
    echo $thumbnail;
    ?>
	</div><!-- #post-media -->

<?php 
}
开发者ID:iq007,项目名称:MadScape,代码行数:29,代码来源:cpt-single-media.php


示例3: wpex_get_post_thumbnail

				<div class="wpex-carousel-slide wpex-clr<?php 
            if ($entry_css) {
                echo ' ' . $entry_css;
            }
            ?>
">

					<?php 
            // Display media
            if ('true' == $media && has_post_thumbnail()) {
                ?>
						
						<?php 
                // Image html
                $img_html = wpex_get_post_thumbnail(array('size' => $img_size, 'crop' => $img_crop, 'width' => $img_width, 'height' => $img_height, 'alt' => wpex_get_esc_title()));
                ?>

						<div class="<?php 
                echo $media_classes;
                ?>
">

							<?php 
                // No links
                if ('none' == $thumbnail_link) {
                    ?>

								<?php 
                    echo $img_html;
                    ?>
开发者ID:iq007,项目名称:MadScape,代码行数:30,代码来源:vcex_post_type_carousel.php


示例4: output

 /**
  * Tweaks the default WP Gallery Output
  *
  * @since 1.0.0
  */
 public static function output($output, $attr)
 {
     // Main Variables
     global $post, $wp_locale, $instance;
     $instance++;
     static $instance = 0;
     $output = '';
     // Sanitize orderby statement
     if (isset($attr['orderby'])) {
         $attr['orderby'] = sanitize_sql_orderby($attr['orderby']);
         if (!$attr['orderby']) {
             unset($attr['orderby']);
         }
     }
     // Get shortcode attributes
     extract(shortcode_atts(array('order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'columns' => 3, 'include' => '', 'exclude' => '', 'img_height' => '', 'img_width' => '', 'size' => '', 'crop' => ''), $attr));
     // Get post ID
     $id = intval($id);
     if ('RAND' == $order) {
         $orderby = 'none';
     }
     if (!empty($include)) {
         $include = preg_replace('/[^0-9,]+/', '', $include);
         $_attachments = get_posts(array('include' => $include, 'post_status' => '', 'inherit' => '', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
         $attachments = array();
         foreach ($_attachments as $key => $val) {
             $attachments[$val->ID] = $_attachments[$key];
         }
     } elseif (!empty($exclude)) {
         $exclude = preg_replace('/[^0-9,]+/', '', $exclude);
         $attachments = get_children(array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
     } else {
         $attachments = get_children(array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby));
     }
     if (empty($attachments)) {
         return '';
     }
     if (is_feed()) {
         $output = "\n";
         $size = $size ? $size : 'thumbnail';
         foreach ($attachments as $attachment_id => $attachment) {
             $output .= wp_get_attachment_link($attachment_id, $size, true) . "\n";
         }
         return $output;
     }
     // Get columns #
     $columns = intval($columns);
     // Set cropping sizes
     if ($columns > 1) {
         $img_width = $img_width ? $img_width : wpex_get_mod('gallery_image_width');
         $img_height = $img_height ? $img_height : wpex_get_mod('gallery_image_height');
     }
     // Sanitize Data
     $size = $size ? $size : 'large';
     $size = $img_width || $img_height ? 'wpex_custom' : $size;
     $crop = $crop ? $crop : 'center-center';
     // Float
     $float = is_rtl() ? 'right' : 'left';
     // Load lightbox skin stylesheet
     wpex_enqueue_ilightbox_skin();
     // Begin output
     $output .= '<div id="gallery-' . $instance . '" class="wpex-gallery wpex-row lightbox-group clr">';
     // Begin Loop
     $count = 0;
     foreach ($attachments as $attachment_id => $attachment) {
         // Increase counter for clearing floats
         $count++;
         // Attachment Vars
         $attachment_data = wpex_get_attachment_data($attachment_id);
         $alt = $attachment_data['alt'];
         $caption = $attachment_data['caption'];
         $video = $attachment_data['video'];
         $lightbox_url = $video ? $video : wpex_get_lightbox_image($attachment_id);
         // Generate the image HTMl
         $img_html = wpex_get_post_thumbnail(array('attachment' => $attachment_id, 'size' => $size, 'width' => $img_width, 'height' => $img_height, 'crop' => $crop));
         // Add data attributes for lightbox
         if ($video) {
             $lightbox_data = ' data-options="thumbnail: \'' . wpex_get_lightbox_image($attachment_id) . '\', width:1920, height:1080"';
         } else {
             $lightbox_data = ' data-type="image"';
         }
         // Start Gallery Item
         $output .= '<figure class="gallery-item ' . wpex_grid_class($columns) . ' col col-' . $count . '">';
         // Display image
         $output .= '<a href="' . $lightbox_url . '" title="' . wp_strip_all_tags($caption) . '" class="wpex-lightbox-group-item"' . $lightbox_data . '>';
         $output .= $img_html;
         $output .= '</a>';
         // Display Caption
         if (trim($attachment->post_excerpt)) {
             if (wpex_is_front_end_composer()) {
                 $output .= '<div class="gallery-caption">' . wptexturize($attachment->post_excerpt) . '</div>';
             } else {
                 $output .= '<figcaption class="gallery-caption">' . wptexturize($attachment->post_excerpt) . '</figcaption>';
             }
         }
//.........这里部分代码省略.........
开发者ID:iq007,项目名称:MadScape,代码行数:101,代码来源:custom-wp-gallery.php


示例5: wpex_get_staff_post_thumbnail

/**
 * Returns correct thumbnail HTML for the staff posts
 *
 * @since 2.0.0
 */
function wpex_get_staff_post_thumbnail()
{
    return wpex_get_post_thumbnail(apply_filters('wpex_get_staff_post_thumbnail_args', array('size' => 'staff_post', 'class' => 'staff-single-media-img', 'alt' => wpex_get_esc_title(), 'schema_markup' => true)));
}
开发者ID:iq007,项目名称:MadScape,代码行数:9,代码来源:staff-helpers.php


示例6: array_unique

// Add featured image to the array
$secondary_attachment_url = '';
if (!empty($attachment_ids)) {
    $attachment_ids = array_unique($attachment_ids);
    // remove duplicate images
    if (count($attachment_ids) > '1') {
        if ($attachment_ids['0'] !== $attachment) {
            $secondary_img_id = $attachment_ids['0'];
        } elseif ($attachment_ids['1'] !== $attachment) {
            $secondary_img_id = $attachment_ids['1'];
        }
    }
}
// Get secondary image output
if (!empty($secondary_img_id)) {
    $secondary_image = wpex_get_post_thumbnail(array('attachment' => $secondary_img_id, 'size' => 'shop_catalog', 'class' => 'woo-entry-image-secondary'));
} else {
    $secondary_image = false;
}
// Return thumbnail
if ($main_image && $secondary_image) {
    ?>

    <div class="woo-entry-image-swap clr">
        <?php 
    echo $main_image;
    ?>
        <?php 
    echo $secondary_image;
    ?>
    </div><!-- .woo-entry-image-swap -->
开发者ID:VanessaGarcia-Freelance,项目名称:TheEmporiumGroup,代码行数:31,代码来源:image-swap.php


示例7: apply_filters

 * @package Total WordPress theme
 * @subpackage Partials
 * @version 3.0.0
 */
// Exit if accessed directly
if (!defined('ABSPATH')) {
    exit;
}
// Disable embeds
$show_embeds = apply_filters('wpex_related_blog_posts_embeds', false);
// Check if experts are enabled
$has_excerpt = wpex_get_mod('blog_related_excerpt', true);
// Get post format
$format = get_post_format();
// Get featured image
$thumbnail = wpex_get_post_thumbnail(array('size' => 'blog_related'));
// Add classes
$classes = array('related-post', 'clr', 'nr-col');
$classes[] = wpex_grid_class($wpex_columns);
$classes[] = 'col-' . $wpex_count;
?>

<article <?php 
post_class($classes);
?>
>

	<?php 
// Display post video
if ($show_embeds && 'video' == $format && ($video = wpex_get_post_video_html())) {
    ?>
开发者ID:iq007,项目名称:MadScape,代码行数:31,代码来源:blog-single-related-entry.php


示例8: cart_item_thumbnail

 /**
  * Alter the cart item thumbnail size
  *
  * @since 3.0.0
  */
 public static function cart_item_thumbnail($thumb, $cart_item, $cart_item_key)
 {
     if (!empty($cart_item['variation_id']) && ($thumbnail = get_post_thumbnail_id($cart_item['variation_id']))) {
         return wpex_get_post_thumbnail(array('size' => 'shop_thumbnail', 'attachment' => $thumbnail));
     } elseif (isset($cart_item['product_id']) && ($thumbnail = get_post_thumbnail_id($cart_item['product_id']))) {
         return wpex_get_post_thumbnail(array('size' => 'shop_thumbnail', 'attachment' => $thumbnail));
     } else {
         return wc_placeholder_img();
     }
 }
开发者ID:iq007,项目名称:MadScape,代码行数:15,代码来源:woocommerce-config.php


示例9: foreach

			<?php 
    // Loop through attachments
    foreach ($attachments as $attachment => $custom_link) {
        ?>

				<?php 
        // Define main vars
        $custom_link = '#' != $custom_link ? $custom_link : '';
        $attachment_link = get_post_meta($attachment, '_wp_attachment_url', true);
        $attachment_data = wpex_get_attachment_data($attachment);
        $caption_type = $caption_type ? $caption_type : 'caption';
        $caption_output = $attachment_data[$caption_type];
        $attachment_video = wp_oembed_get($attachment_data['video']);
        $attachment_video = wpex_add_sp_video_to_oembed($attachment_video);
        // Generate img HTML
        $attachment_img = wpex_get_post_thumbnail(array('attachment' => $attachment, 'size' => $img_size, 'crop' => $img_crop, 'width' => $img_width, 'height' => $img_height, 'alt' => $attachment_data['alt']));
        ?>

				<div class="wpex-slider-slide sp-slide">

					<div class="wpex-slider-media">

						<?php 
        // Check if the current attachment has a video
        if ($attachment_video) {
            ?>

							<div class="wpex-slider-video responsive-video-wrap">
								<?php 
            echo $attachment_video;
            ?>
开发者ID:iq007,项目名称:MadScape,代码行数:31,代码来源:vcex_image_flexslider.php


示例10: post_author_bio_data

 /**
  * Alters post author bio data based on staff item relations
  *
  * @since 2.1.0
  */
 public static function post_author_bio_data($data)
 {
     $relations = get_option('wpex_staff_users_relations');
     $staff_member_id = isset($relations[$data['post_author']]) ? $relations[$data['post_author']] : '';
     if ($staff_member_id) {
         $data['author_name'] = get_the_title($staff_member_id);
         $data['posts_url'] = get_the_permalink($staff_member_id);
         $featured_image = wpex_get_post_thumbnail(array('attachment' => get_post_thumbnail_id($staff_member_id), 'size' => 'wpex_custom', 'width' => $data['avatar_size'], 'height' => $data['avatar_size'], 'alt' => $data['author_name']));
         if ($featured_image) {
             $data['avatar'] = $featured_image;
         }
     }
     return $data;
 }
开发者ID:iq007,项目名称:MadScape,代码行数:19,代码来源:staff-config.php


示例11: wpex_get_blog_post_thumbnail

/**
 * Returns the blog post thumbnail
 *
 * @since 1.0.0
 */
function wpex_get_blog_post_thumbnail($args = '')
{
    // If args isn't array then it's the attachment
    if (!is_array($args) && !empty($args)) {
        $args = array('attachment' => $args, 'alt' => wpex_get_esc_title(), 'width' => '', 'height' => '', 'class' => '', 'schema_markup' => false);
    }
    // Defaults
    $defaults = array('size' => 'blog_post', 'schema_markup' => true);
    // Parse arguments
    $args = wp_parse_args($args, $defaults);
    // Apply filter to args
    $args = apply_filters('wpex_blog_entry_thumbnail_args', $args);
    // Generate thumbnail
    $thumbnail = wpex_get_post_thumbnail($args);
    // Apply filters for child theming
    return apply_filters('wpex_blog_post_thumbnail', $thumbnail);
}
开发者ID:VanessaGarcia-Freelance,项目名称:TheEmporiumGroup,代码行数:22,代码来源:blog-functions.php


示例12: stdClass

            $wpex_query->the_post();
            // Create new post object.
            $post = new stdClass();
            // Get attachment ID
            $post->id = get_the_ID();
            // Attachment VARS
            $post->data = wpex_get_attachment_data($post->id);
            $post->link = $post->data['url'];
            $post->alt = esc_attr($post->data['alt']);
            $post->title_display = false;
            // Pluck array to see if item has custom link
            $post->url = $images_links_array[$post->id];
            // Validate URl
            $post->url = '#' !== $post->url ? $post->url : '';
            // Set image HTML since we'll use it a lot later on
            $post->thumbnail = wpex_get_post_thumbnail(array('size' => $img_size, 'attachment' => $post->id, 'alt' => $post->alt, 'width' => $img_width, 'height' => $img_height, 'crop' => $img_crop));
            ?>

				<div class="id-<?php 
            echo $post->id . ' ' . $entry_classes;
            ?>
 col-<?php 
            echo $count;
            ?>
">

					<figure class="<?php 
            echo $figure_classes;
            ?>
">
开发者ID:iq007,项目名称:MadScape,代码行数:30,代码来源:vcex_image_grid.php


示例13: wpex_get_testimonials_entry_thumbnail

/**
 * Returns correct thumbnail HTML for the testimonials entries
 *
 * @since 2.0.0
 */
function wpex_get_testimonials_entry_thumbnail()
{
    return wpex_get_post_thumbnail(array('size' => 'testimonials_entry', 'class' => 'testimonials-entry-img', 'alt' => wpex_get_esc_title()));
}
开发者ID:iq007,项目名称:MadScape,代码行数:9,代码来源:testimonials-helpers.php


示例14: widget

    /**
     * Front-end display of widget.
     *
     * @see WP_Widget::widget()
     *
     * @param array $args     Widget arguments.
     * @param array $instance Saved values from database.
     */
    function widget($args, $instance)
    {
        // Set vars
        $title = isset($instance['title']) ? apply_filters('widget_title', $instance['title']) : __('Recent Posts', 'wpex');
        $number = isset($instance['number']) ? $instance['number'] : '3';
        $style = isset($instance['style']) ? $instance['style'] : 'default';
        $order = isset($instance['order']) ? $instance['order'] : '';
        $date = isset($instance['date']) ? $instance['date'] : '';
        $post_type = isset($instance['post_type']) ? $instance['post_type'] : '';
        $taxonomy = isset($instance['taxonomy']) ? $instance['taxonomy'] : '';
        $terms = isset($instance['terms']) ? $instance['terms'] : '';
        $img_hover = isset($instance['img_hover']) ? $instance['img_hover'] : '';
        $img_size = isset($instance['img_size']) ? $instance['img_size'] : 'wpex_custom';
        $img_height = !empty($instance['img_height']) ? intval($instance['img_height']) : '';
        $img_width = !empty($instance['img_width']) ? intval($instance['img_width']) : '';
        $img_size = $img_width || $img_height ? 'wpex_custom' : $img_size;
        $exclude = is_singular() ? array(get_the_ID()) : NULL;
        // Sanitize terms
        if ($terms) {
            $terms = str_replace(', ', ',', $terms);
            $terms = explode(',', $terms);
        }
        // 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 clr style-<?php 
        echo $style;
        ?>
">

			<?php 
        // Query args
        $query_args = array('post_type' => $post_type, 'posts_per_page' => $number, 'orderby' => $order, 'post__not_in' => $exclude, 'meta_key' => '_thumbnail_id', 'no_found_rows' => true);
        // Taxonomy args
        if (!empty($taxonomy) && !empty($terms)) {
            $query_args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'slug', 'terms' => $terms));
        }
        // Query posts
        $my_query = new WP_Query($query_args);
        // If there are posts loop through them
        if ($my_query->have_posts()) {
            // Loop through posts
            while ($my_query->have_posts()) {
                $my_query->the_post();
                ?>
				
					<?php 
                // Get post thumbnail
                $thumbnail = wpex_get_post_thumbnail(array('size' => $img_size, 'width' => $img_width, 'height' => $img_height, 'alt' => wpex_get_esc_title()));
                ?>

					<?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 ($thumbnail) {
                    ?>
							<a href="<?php 
                    wpex_permalink();
                    ?>
" title="<?php 
                    wpex_esc_title();
                    ?>
" class="wpex-widget-recent-posts-thumbnail<?php 
                    echo $hover_classes;
                    ?>
"><?php 
                    echo $thumbnail;
                    ?>
</a>
						<?php 
                }
                ?>

						<a href="<?php 
                wpex_permalink();
                ?>
" title="<?php 
                wpex_esc_title();
//.........这里部分代码省略.........
开发者ID:VanessaGarcia-Freelance,项目名称:TheEmporiumGroup,代码行数:101,代码来源:posts-thumbnails.php


示例15: esc_attr

        $post->alt = esc_attr($post->data['alt']);
        $post->caption = $post->data['caption'];
        // Pluck array to see if item has custom link
        $post->url = $images_links_array[$post->id];
        // Validate URl
        $post->url = '#' !== $post->url ? esc_url($post->url) : '';
        // Get correct title
        if ('title' == $title_type) {
            $attachment_title = get_the_title();
        } elseif ('alt' == $title_type) {
            $attachment_title = esc_attr($post->data['alt']);
        } else {
            $attachment_title = get_the_title();
        }
        // Image output
        $image_output = wpex_get_post_thumbnail(array('attachment' => $post->id, 'crop' => $img_crop, 'size' => $img_size, 'width' => $img_width, 'height' => $img_height, 'alt' => $post->alt));
        ?>

			<div class="wpex-carousel-slide">

				<div class="<?php 
        echo $img_classes;
        ?>
">

					<?php 
        // Add custom links to attributes for use with the overlay styles
        if ('custom_link' == $thumbnail_link && $post->url) {
            $atts['overlay_link'] = $post->url;
        }
        // Lightbox
开发者ID:VanessaGarcia-Freelance,项目名称:TheEmporiumGroup,代码行数:31,代码来源:vcex_image_carousel.php


示例16: foreach

    foreach ($attachment_ids as $attachment_id) {
        ?>

                <?php 
        // Add to counter
        $count++;
        ?>

                <?php 
        // Only display the first 5 images
        if ($count < 5) {
            ?>

                    <?php 
            // Get thumbnail
            $thumbnail = wpex_get_post_thumbnail(array('attachment' => $attachment_id, 'size' => 'shop_catalog'));
            ?>

                    <?php 
            // Display thumbnail if there is one
            if ($thumbnail) {
                ?>

                        <div class="wpex-slider-slide sp-slide">
                            <?php 
                echo $thumbnail;
                ?>
                        </div><!-- .wpex-slider-slide -->

                    <?php 
            }
开发者ID:VanessaGarcia-Freelance,项目名称:TheEmporiumGroup,代码行数:31,代码来源:gallery-slider.php


示例17: wpex_post_thumbnail

/**
 * Outputs the img HTMl thubmails used in the Total VC modules
 *
 * @since 2.0.0
 */
function wpex_post_thumbnail($args = array())
{
    echo wpex_get_post_thumbnail($args);
}
开发者ID:iq007,项目名称:MadScape,代码行数:9,代码来源:core-functions.php


示例18: widget

    /**
     * Front-end display of widget.
     *
     * @see WP_Widget::widget()
     *
     * @param array $args     Widget arguments.
     * @param array $instance Saved values from database.
     */
    function widget($args, $instance)
    {
        // Set vars for widget usage
        $title = isset($instance['title']) ? $instance['title'] : '';
        $title = apply_filters('widget_title', $title);
        $post_type = isset($instance['post_type']) ? $instance['post_type'] : '';
        $taxonomy = isset($instance['taxonomy']) ? $instance['taxonomy'] : '';
        $terms = isset($instance['terms']) ? $instance['terms'] : '';
        $number = isset($instance['number']) ? $instance['number'] : '';
        $order = isset($instance['order']) ? $instance['order'] : '';
        $columns = isset($instance['columns']) ? $instance['columns'] : '3';
        $img_hover = isset($instance['img_hover']) ? $instance['img_hover'] : '';
        $img_size = isset($instance['img_size']) ? $instance['img_size'] : 'wpex_custom';
        $img_height = !empty($instance['img_height']) ? intval($instance['img_height']) : '';
        $img_width = !empty($instance['img_width']) ? intval($instance['img_width']) : '';
        $img_size = $img_width || $img_height ? 'wpex_custom' : $img_size;
        $exclude = is_singular() ? array(get_the_ID()) : NULL;
        // Sanitize terms
        if ($terms) {
            $terms = str_replace(', ', ',', $terms);
            $terms = explode(',', $terms);
        }
        // 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-recent-posts-thumb-grid wpex-row clr">

			<?php 
        // Query args
        $query_args = array('post_type' => $post_type, 'posts_per_page' => $number, 'orderby' => $order, 'meta_key' => '_thumbnail_id', 'post__not_in' => $exclude, 'no_found_rows' => true);
        // Taxonomy args
        if (!empty($taxonomy) && !empty($terms)) {
            $query_args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'slug', 'terms' => $terms));
        }
        // Query posts
        $my_query = new WP_Query($query_args);
        ?>
			
			<?php 
        // Set post counter variable
        $count = 0;
        ?>

			<?php 
        // Loop through posts
        while ($my_query->have_posts()) {
            $my_query->the_post();
            ?>

				<?php 
            // Add to counter variable
            $count++;
            ?>
				
				<?php 
            // Get post thumbnail
            $thumbnail = wpex_get_post_thumbnail(array('size' => $img_size, 'width' => $img_width, 'height' => $img_height, 'alt' => wpex_get_esc_title()));
            ?>

				<?php 
            // Get hover classes
            if ($img_hover) {
                $hover_classes = ' class="' . wpex_image_hover_classes($img_hover) . '"';
            } else {
                $hover_classes = '';
            }
            ?>

				<li class="<?php 
            echo wpex_grid_class($columns);
            ?>
 nr-col col-<?php 
            echo $count;
            ?>
">
					<a href="<?php 
            wpex_permalink();
            ?>
" title="<?php 
            wpex_esc_title();
            ?>
"<?php 
            echo $hover_classes;
            ?>
><?php 
            echo $thumbnail;
            ?>
//.........这里部分代码省略.........
开发者ID:VanessaGarcia-Freelance,项目名称:TheEmporiumGroup,代码行数:101,代码来源:posts-grid.php


示例19: wpex_get_permalink

        $post_permalink = wpex_get_permalink($post_id);
        $post_format = get_post_format($post_id);
        $post_thumbnail = wp_get_attachment_url(get_post_thumbnail_id());
        ?>

			<div class="vcex-post-type-list-entry vcex-clr vcex-count-<?php 
        echo $count;
        ?>
">

				<?php 
        // Featured post
        if ('true' == $featured_post && '1' == $count) {
            // Featured post => image
            if ($post_thumbnail) {
                $post_thumbnail = wpex_get_post_thumbnail(array('size' => $featured_post_img_size, 'crop' => $featured_post_img_crop, 'width' => $featured_post_img_width, 'height' => $featured_post_img_height, 'alt' => $post_title_esc));
            }
            ?>

					<div class="vcex-post-type-list-thumbnail vcex-clr">
						<?php 
            echo $post_thumbnail;
            ?>
					</div><!-- .vcex-post-type-list-thumbnail -->

					<div class="vcex-post-type-list-title vcex-clr">
						<h2 class="entry-title"><?php 
            echo $post_title;
            ?>
</h2>
					</div><!-- .vcex-post-type-list-title -->
开发者ID:iq007,项目名称:MadScape,代码行数:31,代码来源:vcex_post_type_list.php



注:本文中的wpex_get_post_thumbnail函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wpex_get_theme_branding函数代码示例发布时间:2022-05-23
下一篇:
PHP wpex_get_post_layout_class函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap