本文整理汇总了PHP中etheme_get_image函数的典型用法代码示例。如果您正苦于以下问题:PHP etheme_get_image函数的具体用法?PHP etheme_get_image怎么用?PHP etheme_get_image使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了etheme_get_image函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_post_thumbnail_id
<?php
}
?>
<?php
if (has_post_thumbnail()) {
?>
<?php
$img_id = get_post_thumbnail_id($post->ID);
$alt_text = get_post_meta($img_id, '_wp_attachment_image_alt', true);
?>
<a href="<?php
the_permalink();
?>
" id="<?php
echo etheme_get_image(false, 800, 1000, false);
?>
" class="product-content-image <?php
if ($hover == 'tooltip') {
?>
imageTooltip<?php
}
?>
<?php
if ($hoverUrl != '') {
?>
with-hover<?php
}
?>
" data-images-list="<?php
echo get_images_list($width, $height, $crop);
示例2: foreach
if (count($attachments) > 4 && $product_layout == 'universal') {
?>
jcarousel-horizontal<?php
}
?>
">
<?php
foreach ($attachments as $id => $attachment) {
if ($id == $main_img_id) {
continue;
}
$thumb_width = 68;
$thumb_height = 68;
$thumb_img = etheme_get_image($id, $thumb_width, $thumb_height, false);
$big_img = etheme_get_image($id, $big_width, $big_height, false);
$full_img = etheme_get_image($id, false, false, false);
$img_title = get_post_meta($id, '_wp_attachment_image_alt', true);
if (!$img_title) {
$img_title = get_post_field('post_title', $id);
}
?>
<li class="slide">
<a href="<?php
echo $full_img;
?>
"
<?php
if (etheme_get_option('cloud_zoom')) {
?>
class="cloud-zoom-gallery"<?php
} else {
示例3: wp_get_attachment_url
if (get_post_meta($id, '_woocommerce_exclude_image', true) == 1) {
continue;
}
?>
<li class="slide">
<a href="<?php
echo wp_get_attachment_url($id);
?>
" class="image" <?php
if ($zoom == 'disable') {
?>
rel="lightbox[gal]"<?php
}
?>
data-easyzoom-source="<?php
echo etheme_get_image($id, $mainWidth, $mainHeight, $crop);
?>
">
<?php
echo wp_get_attachment_image($id, apply_filters('single_product_small_thumbnail_size', 'shop_thumbnail'));
?>
</a>
</li>
<?php
}
?>
</ul>
</div>
<?php
if (count($attachment_ids) > 2 && $product_layout != 'variant3') {
示例4: get_images_list
function get_images_list($width, $height, $crop)
{
global $post, $product, $woocommerce;
$images_string = '';
$attachment_ids = $product->get_gallery_attachment_ids();
$_i = 0;
$images_string .= etheme_get_image(false, $width, $height, $crop);
if (count($attachment_ids) > 0) {
$images_string .= ',';
foreach ($attachment_ids as $value) {
$_i++;
$images_string .= etheme_get_image($value, $width, $height, $crop);
if ($_i != count($attachment_ids)) {
$images_string .= ',';
}
}
}
return $images_string;
}
示例5: etheme_featured_post_shortcode
function etheme_featured_post_shortcode($atts)
{
$a = shortcode_atts(array('title' => '', 'id' => '', 'class' => '', 'more_posts' => 1), $atts);
$limit = 1;
$width = 300;
$height = 300;
$lightbox = etheme_get_option('blog_lightbox');
$blog_slider = etheme_get_option('blog_slider');
$posts_url = get_permalink(get_option('page_for_posts'));
$args = array('p' => $a['id'], 'post_type' => 'post', 'ignore_sticky_posts' => 1, 'no_found_rows' => 1, 'posts_per_page' => $limit);
$the_query = new WP_Query($args);
ob_start();
?>
<?php
if ($the_query->have_posts()) {
?>
<?php
while ($the_query->have_posts()) {
$the_query->the_post();
$postId = get_the_ID();
?>
<div class="featured-posts <?php
echo $a['class'];
?>
">
<?php
if ($a['title'] != '') {
?>
<h3 class="title a-left"><span><?php
echo $a['title'];
?>
</span></h3>
<?php
if ($a['more_posts']) {
?>
<?php
echo '<a href="' . $posts_url . '" class="show-all-posts hidden-tablet hidden-phone">' . __('View more posts', ETHEME_DOMAIN) . '</a>';
?>
<?php
}
?>
<?php
}
?>
<div class="featured-post row">
<div class="col-md-6">
<?php
$width = etheme_get_option('blog_page_image_width');
$height = etheme_get_option('blog_page_image_height');
$crop = etheme_get_option('blog_page_image_cropping');
?>
<?php
$images = etheme_get_images($width, $height, $crop);
?>
<?php
if (count($images) > 0 && has_post_thumbnail()) {
?>
<div class="post-images nav-type-small<?php
if (count($images) > 1) {
?>
images-slider<?php
}
?>
">
<ul class="slides">
<li><a href="<?php
the_permalink();
?>
"><img src="<?php
echo $images[0];
?>
"></a></li>
</ul>
<div class="blog-mask">
<div class="mask-content">
<?php
if ($lightbox) {
?>
<a href="<?php
echo etheme_get_image(get_post_thumbnail_id($postId));
?>
" rel="lightbox"><i class="fa fa-resize-full"></i></a><?php
}
?>
<a href="<?php
the_permalink();
?>
"><i class="fa fa-link"></i></a>
</div>
</div>
</div>
<?php
}
?>
</div>
//.........这里部分代码省略.........
示例6: the_permalink
the_permalink();
?>
"><img src="<?php
echo $imgSrc;
?>
" alt="<?php
the_title();
?>
"></a>
<div class="zoom">
<div class="btn_group">
<?php
if ($lightbox) {
?>
<a href="<?php
echo etheme_get_image(get_post_thumbnail_id($postId));
?>
" class="btn btn-black xmedium-btn" rel="lightbox"><span><?php
_e('View large', ETHEME_DOMAIN);
?>
</span></a><?php
}
?>
<a href="<?php
the_permalink();
?>
" class="btn btn-black xmedium-btn"><span><?php
_e('More details', ETHEME_DOMAIN);
?>
</span></a>
</div>
示例7: foreach
$catsClass = '';
foreach ($categories as $category) {
$catsClass .= ' sort-' . $category->slug;
}
$columns = etheme_get_option('portfolio_columns');
?>
<div class="portfolio-item <?php
echo $catsClass;
?>
">
<div class="portfolio-image">
<?php
if (has_post_thumbnail($postId)) {
?>
<?php
$image = etheme_get_image(false, 220, 220);
?>
<a href="<?php
the_permalink();
?>
"><img src="<?php
echo $image;
?>
" /></a>
<?php
}
?>
<div class="portfolio-mask"></div>
<div class="portfolio-descr">
<h3><?php
示例8: foreach
$catsClass = '';
foreach ($categories as $category) {
$catsClass .= ' sort-' . $category->slug;
}
$columns = etheme_get_option('portfolio_columns');
if ($_GET['col']) {
$columns = $_GET['col'];
}
?>
<div class="portfolio-item article <?php
echo $catsClass;
?>
">
<div class="portfolio-image">
<img src="<?php
echo etheme_get_image(false, 600, 600);
?>
" title="<?php
the_title();
?>
"/>
<div class="portfolio-mask"></div>
<div class="portfolio-descr">
<?php
if ($columns != 1) {
?>
<h3><?php
the_title();
?>
</h3>
<?php
示例9: etheme_get_image
}
?>
<a href="<?php
echo etheme_get_image($value);
?>
" <?php
if ($zoom == 'disable') {
?>
rel="<?php
echo $lightbox_rel;
?>
"<?php
}
?>
class="main-image zoom"><img src="<?php
echo etheme_get_image($value, $mainImageWidth, $mainImageHeight, $mainImageCrop);
?>
" title="<?php
$image_title;
?>
"></a></li>
<?php
}
?>
<?php
}
?>
<?php
}
?>
示例10: do_action
<?php
do_action('woocommerce_before_shop_loop_item');
?>
<?php
woocommerce_get_template('loop/sale-flash.php');
?>
<?php
$placeholder_width = wc_get_image_size('shop_catalog_image_width');
$placeholder_height = wc_get_image_size('shop_catalog_image_height');
$url = wp_get_attachment_image_src(get_post_thumbnail_id($product->ID), array(260, 260));
if (has_post_thumbnail()) {
?>
<a id="<?php
echo etheme_get_image($product->ID, 400, 400, false);
?>
" href="<?php
echo the_permalink();
?>
"
class="product-image <?php
if ($product_img_hover == 'tooltip') {
?>
imageTooltip<?php
}
?>
">
<?php
if (etheme_get_custom_field('_etheme_hover') && $product_img_hover == 'swap') {
?>
示例11: woothemes_testimonials
/**
* Display or return HTML-formatted testimonials.
* @param string/array $args Arguments.
* @since 1.0.0
* @return string
*/
function woothemes_testimonials($args = '')
{
global $post;
$defaults = array('limit' => 5, 'orderby' => 'menu_order', 'interval' => 10000, 'order' => 'DESC', 'id' => 0, 'display_author' => true, 'display_avatar' => true, 'display_url' => true, 'pagination' => false, 'echo' => true, 'size' => 30, 'title' => '', 'before' => '', 'after' => '', 'before_title' => '', 'after_title' => '', 'type' => 'slider', 'columns' => 3, 'navigation' => false, 'category' => 0);
$img_size = 40;
$args = wp_parse_args($args, $defaults);
// Allow child themes/plugins to filter here.
$args = apply_filters('woothemes_testimonials_args', $args);
$html = '';
do_action('woothemes_testimonials_before', $args);
// The Query.
$query = woothemes_get_testimonials($args);
$class = 'cbp-qtrotator';
if ($args['type'] == 'slider') {
$class = 'owl-carousel testimonials-slider';
} elseif ($args['type'] == 'grid') {
$img_size = 60;
$class = 'testimonial-grid';
}
// The Display.
if (!is_wp_error($query) && is_array($query) && count($query) > 0) {
$html .= $args['before'] . "\n";
if ('' != $args['title']) {
$html .= $args['before_title'] . esc_html($args['title']) . $args['after_title'] . "\n";
}
$html .= '<div id="owl-testimonials" class="' . $class . ' testimonials" data-navigation="' . $args['navigation'] . '" data-interval="' . $args['interval'] . '" >' . "\n";
// Begin templating logic.
if ($args['type'] == 'slider') {
$tpl = '<div id="quote-%%ID%%" class="item %%CLASS%%"><blockquote class="testimonials-text">%%TEXT%%</blockquote><div class="testimonial-info"> %%AVATAR%% <div class="testimonial-author">%%AUTHOR%%</div></div> <div class="clear"></div></div>';
} elseif ($args['type'] == 'grid') {
$tpl = '<div id="quote-%%ID%%" class="item col-lg-4 %%CLASS%%"><blockquote class="testimonials-text">%%TEXT%%</blockquote><div class="testimonial-info">%%AVATAR%% <div class="testimonial-author">%%AUTHOR%%</div></div> <div class="clear"></div></div>';
}
$tpl = apply_filters('woothemes_testimonials_item_template', $tpl, $args);
$count = 0;
if ($args['type'] == 'grid') {
$html .= '<div class="row">';
}
foreach ($query as $post) {
$count++;
$template = $tpl;
$css_class = 'quote';
if (1 == $count) {
$css_class .= ' first';
}
if (count($query) == $count) {
$css_class .= ' last';
}
setup_postdata($post);
$author = '';
$author_text = '';
// If we need to display the author, get the data.
if (get_the_title($post) != '' && true == $args['display_author']) {
$author .= '<cite class="author">';
$author_name = get_the_title($post);
$author .= '<strong>' . $author_name . '</strong>';
if (isset($post->byline) && '' != $post->byline) {
$author .= ' <span class="excerpt">' . $post->byline . '</span><!--/.excerpt-->' . "\n";
}
if (true == $args['display_url'] && '' != $post->url) {
$author .= ' <span class="url"><a href="' . esc_url($post->url) . '">' . $post->url . '</a></span><!--/.excerpt-->' . "\n";
}
$author .= '</cite><!--/.author-->' . "\n";
// Templating engine replacement.
$template = str_replace('%%AUTHOR%%', $author, $template);
} else {
$template = str_replace('%%AUTHOR%%', '', $template);
}
// Templating logic replacement.
$template = str_replace('%%ID%%', get_the_ID(), $template);
$template = str_replace('%%CLASS%%', esc_attr($css_class), $template);
if (isset($post->image) && '' != $post->image && true == $args['display_avatar']) {
$image = '<img src="' . etheme_get_image(false, $img_size, $img_size, true) . '">';
$template = str_replace('%%AVATAR%%', '<a class="avatar-link">' . $image . '</a>', $template);
} else {
$template = str_replace('%%AVATAR%%', '', $template);
}
// Remove any remaining %%AVATAR%% template tags.
$template = str_replace('%%AVATAR%%', '', $template);
$content = apply_filters('woothemes_testimonials_content', get_the_content(), $post);
$template = str_replace('%%TEXT%%', $content, $template);
// Assign for output.
$html .= $template;
if ($count % $args['columns'] == 0 && count($query) != $count && $args['type'] == 'grid') {
$html .= '<div class="clear"></div></div><div class="row">';
}
}
if ($args['type'] == 'grid') {
$html .= '<div class="clear"></div></div><!--row-->';
}
wp_reset_postdata();
if ($args['pagination'] == true && count($query) > 1 && $args['effect'] != 'none') {
$html .= '<div class="pagination">' . "\n";
$html .= '<a href="#" class="btn-prev">' . apply_filters('woothemes_testimonials_prev_btn', '← ' . __('Previous', ETHEME_DOMAIN)) . '</a>' . "\n";
$html .= '<a href="#" class="btn-next">' . apply_filters('woothemes_testimonials_next_btn', __('Next', ETHEME_DOMAIN) . ' →') . '</a>' . "\n";
//.........这里部分代码省略.........
示例12: etheme_woocommerce_subcategory_thumbnail
function etheme_woocommerce_subcategory_thumbnail($category)
{
global $woocommerce;
$small_thumbnail_size = apply_filters('single_product_small_thumbnail_size', 'shop_catalog');
$dimensions = wc_get_image_size($small_thumbnail_size);
$thumbnail_id = get_woocommerce_term_meta($category->term_id, 'thumbnail_id', true);
if ($thumbnail_id) {
$image = etheme_get_image($thumbnail_id, 215, 215, false);
} else {
$image = wc_placeholder_img_src();
}
if ($image) {
echo '<img src="' . $image . '" alt="' . $category->name . '" width="' . $dimensions['width'] . '" height="' . $dimensions['height'] . '" />';
}
}
示例13: widget
function widget($args, $instance)
{
$cache = wp_cache_get('etheme_widget_recent_entries', 'widget');
if (!is_array($cache)) {
$cache = array();
}
if (isset($cache[$args['widget_id']])) {
echo $cache[$args['widget_id']];
return;
}
ob_start();
extract($args);
$title = apply_filters('widget_title', empty($instance['title']) ? false : $instance['title']);
if (!($number = (int) $instance['number'])) {
$number = 10;
} else {
if ($number < 1) {
$number = 1;
} else {
if ($number > 15) {
$number = 15;
}
}
}
$r = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1));
if ($r->have_posts()) {
?>
<?php
echo $before_widget;
?>
<?php
if ($title) {
echo $before_title . $title . $after_title;
}
?>
<div>
<?php
while ($r->have_posts()) {
$r->the_post();
?>
<div class="recent-post-mini">
<?php
$thumb = wp_get_attachment_image_src(get_post_thumbnail_id(), array(130, 130));
$url = $thumb[0];
if ($url && $url != '') {
?>
<a class="postimg" href="<?php
the_permalink();
?>
" title="<?php
echo esc_attr(get_the_title() ? get_the_title() : get_the_ID());
?>
"><img src="<?php
echo etheme_get_image(false, 70, 70);
?>
" /></a>
<?php
}
?>
<?php
if (get_the_title()) {
$title = get_the_title();
} else {
$title = get_the_ID();
}
$title = trunc($title, 10);
?>
<a href="<?php
the_permalink();
?>
" <?php
if (!$url || $url == '') {
echo 'style="width:100%;"';
}
?>
title="<?php
echo esc_attr(get_the_title() ? get_the_title() : get_the_ID());
?>
">
<?php
echo $title;
?>
</a><br />
<?php
_e('by', ETHEME_DOMAIN);
?>
<strong><?php
the_author();
?>
</strong><br>
<?php
the_time(get_option('date_format'));
?>
<div class="clear"></div>
</div>
<?php
}
?>
//.........这里部分代码省略.........
示例14: do_action
if ($woocommerce_loop['loop'] % $woocommerce_loop['columns'] == 0) {
echo ' last';
}
?>
">
<?php
do_action('woocommerce_before_subcategory', $category);
?>
<div class="mask-container">
<?php
$thumbnail_id = get_woocommerce_term_meta($category->term_id, 'thumbnail_id', true);
if ($thumbnail_id) {
$image = etheme_get_image($thumbnail_id);
} else {
$image = woocommerce_placeholder_img_src();
}
if ($image) {
echo '<img src="' . $image . '" alt="' . $category->name . '" />';
}
?>
<div class="block-mask">
<div class="mask-content">
<a href="<?php
echo get_term_link($category->slug, 'product_cat');
?>
"><i class="icon-link"></i></a>
</div>
示例15: wpsc_the_product_id
if (wpsc_show_thumbnails()) {
?>
<div class="imagecol" id="imagecol_<?php
echo wpsc_the_product_id();
?>
">
<?php
etheme_product_labels();
?>
<?php
if (wpsc_the_product_thumbnail()) {
?>
<a id="<?php
echo etheme_get_image($id, 400, 400, false);
?>
"
href="<?php
echo wpsc_the_product_permalink();
?>
"
class="product-image <?php
if ($product_img_hover == 'tooltip') {
?>
imageTooltip<?php
}
?>
">
<?php
if (etheme_get_custom_field('_etheme_hover') && $product_img_hover == 'swap') {