本文整理汇总了PHP中yit_image函数的典型用法代码示例。如果您正苦于以下问题:PHP yit_image函数的具体用法?PHP yit_image怎么用?PHP yit_image使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了yit_image函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
function widget($args, $instance)
{
extract($args);
$yit_portfolio = yit_portfolios();
/* User-selected settings. */
$title = apply_filters('widget_title', $instance['title']);
$project_fx = isset($instance['project_fx']) ? $instance['project_fx'] : false;
$project_easing_fx = isset($instance['project_easing_fx']) ? $instance['project_easing_fx'] : false;
$project_speed_fx = isset($instance['project_speed_fx']) ? $instance['project_speed_fx'] : false;
$project_timeout_fx = isset($instance['project_timeout_fx']) ? $instance['project_timeout_fx'] : false;
$project_n_items = isset($instance['project_n_items']) ? $instance['project_n_items'] : 5;
$project_post_types = isset($instance['project_post_type']) ? $instance['project_post_type'] : 'portfolio';
global $more;
$more = 0;
$post_type = $project_post_types;
if ($project_post_types) {
foreach ($yit_portfolio as $portfolio) {
if ($portfolio->ID == $project_post_types) {
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
echo '<div class="featured-projects-widget flexslider">';
echo '<ul class="slides">';
yit_set_portfolio_loop($portfolio->ID);
$i = 0;
$categories = yit_portfolio_get_setting('categories', $portfolio->ID);
$portfolios = yit_portfolio_get_setting('items', $portfolio->ID);
foreach ($portfolios as $item_id => $item) {
$post_permalink = yit_work_permalink($item_id);
echo '<li>';
echo '<div class="thumb-project">';
echo "<a href='" . $post_permalink . "'>";
yit_image("id={$item_id}&size=featured_project_thumb");
//echo wp_get_attachment_image( $item_id, 'featured_project_thumb' );
echo '</a></div>';
echo '<h4>' . $item['title'] . '</h4>';
echo '<p class="categories">';
$str_categories = '';
$terms = isset($item['terms']) ? $item['terms'] : array();
foreach ($terms as $name) {
$str_categories .= "<a href='" . yit_term_link($name) . "'>{$categories[$name]}</a>, ";
}
echo substr($str_categories, 0, strlen($str_categories) - 2);
echo '</p>';
echo '</li>';
if (++$i == $project_n_items) {
break;
}
}
echo '</ul>';
echo '</div>';
$script = "<script type=\"text/javascript\">\n\t\t jQuery(document).ready(function(\$){\n\t\t \tvar animation = \$.browser.msie || \$.browser.opera ? 'fade' : '{$project_fx}';\n\t\t \$('.featured-projects-widget').flexslider({\n\t\t animation: animation,\n\t\t slideshowSpeed: {$project_timeout_fx},\n\t\t animationSpeed: {$project_speed_fx},\n\t\t selectors: 'ul > li',\n\t\t directionNav: true,\n\t\t slideshow: true,\n\n\t\t\t\t\t\t pauseOnAction: false,\n\t\t\t\t\t\t controlNav: false,\n\t\t\t\t\t\t touch: true\n\t\t });\n\t\t });\n\t\t </script>";
echo $script;
echo $after_widget;
}
}
}
}
示例2: widget
function widget($args, $instance)
{
extract($args);
/* User-selected settings. */
if (!isset($instance['title'])) {
$instance['title'] = '';
}
$title = apply_filters('widget_title', $instance['title']);
$items = isset($instance['items']) ? $instance['items'] : '';
$show_thumb = isset($instance['show_thumb']) ? $instance['show_thumb'] : 'yes';
$date = isset($instance['date_excerpt']) ? $instance['date_excerpt'] : 'no';
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
$args = array('posts_per_page' => $items, 'orderby' => 'date', 'ignore_sticky_posts' => 1);
$args['order'] = 'DESC';
$myposts = new WP_Query($args);
$html = "\n";
$html .= '<div class="recent-post group">' . "\n";
if ($myposts->have_posts()) {
while ($myposts->have_posts()) {
$myposts->the_post();
$img = '';
if (has_post_thumbnail()) {
$img = yit_image("size=blog_thumb", false);
}
/*
else
{ $img = '<img src="'.get_template_directory_uri().'/images/no_image_recentposts.jpg" alt="No Image" />'; }
*/
$html .= '<div class="hentry-post group">' . "\n";
if ($date == 'yes') {
$html .= '<p class="post-date">' . get_the_date('M') . '<br /><span>' . get_the_date('d') . '</span></p>';
}
if ($show_thumb == 'yes' && has_post_thumbnail()) {
$html .= " <div class=\"thumb-img\">{$img}</div>\n";
$html .= '<div class="text">';
} else {
$html .= '<div class="text without-thumbnail">';
}
$html .= the_title('<a href="' . get_permalink() . '" title="' . get_the_title() . '" class="title">', '</a>', false);
$html .= '<span class="posted_by">' . __('posted by', 'yit') . ' <a href="' . get_author_posts_url(get_the_author_meta('ID')) . '">' . get_the_author() . '</a></span>';
$html .= '</div>' . "\n";
$html .= '</div>' . "\n";
}
}
wp_reset_query();
$html .= '</div>';
echo $html;
add_filter('the_content_more_link', 'yit_sc_more_link', 10, 3);
//shortcode in more links
echo $after_widget;
}
示例3: while
<div class="services-row row group">
<?php
while ($services->have_posts()) {
$services->the_post();
?>
<div class="span<?php
echo $items_span;
?>
service-wrapper">
<div class="service group">
<div class="image-wrapper">
<a href="<?php
the_permalink();
?>
" ><?php
echo has_post_thumbnail() ? yit_image('size=section_services&alt=featured image', false) : yit_image('src=' . YIT_CORE_ASSETS_URL . '/images/no-featured-175.jpg&title=' . __('(this post does not have a featured image)', 'yit') . '&alt=no featured image', false);
?>
</a>
</div>
<?php
if ($show_title == "1" || $show_title == 'yes') {
?>
<h4><a href="<?php
the_permalink();
?>
"><?php
echo yit_decode_title(get_the_title());
?>
</a></h4><?php
}
?>
示例4: the_ID
<div class="swiper-pagination pagination-post-<?php
the_ID();
?>
"></div>
<div class="swiper-direction left"><i class="fa fa-chevron-left"></i></div>
<div class="swiper-direction right"><i class="fa fa-chevron-right"></i></div>
</div>
</div>
</div>
<?php
} elseif ($has_thumbnail) {
?>
<div class="col-sm-7 yit_portfolio_thumbnail">
<div class="thumbnail">
<?php
yit_image(array('size' => 'portfolio_single_small', 'class' => 'img-responsive'));
?>
</div>
</div>
<?php
} elseif ($show_extra_content) {
?>
<div class="col-sm-3 yit_portfolio_extra_info">
<?php
if ($show_meta_section) {
?>
<div class="portfolio_meta">
<?php
if ($extra_title != '') {
?>
<h3 class="portfolio_extra_title">
示例5: widget
function widget( $args, $instance ) {
extract( $args );
/* User-selected settings. */
if ( ! isset( $instance['title'] ) )
{
$instance['title'] = '';
}
$title = apply_filters( 'widget_title', $instance['title'] );
$author = get_the_author_link();
$items = isset( $instance['items'] ) ? $instance['items'] : '';
$more_text = isset( $instance['more_text'] ) ? $instance['more_text'] : '';
$show_thumb = isset( $instance['show_thumb'] ) ? $instance['show_thumb'] : 'yes';
$excerpt_length = isset( $instance['excerpt_length'] ) ? $instance['excerpt_length'] : 10;
$date = isset( $instance['date_excerpt'] ) ? $instance['date_excerpt'] : 'no';
$show_comments = isset( $instance ['show_comments'] ) ? $instance['show_comments'] : 'no';
$show_author = isset( $instance ['show_author'] ) && ! empty( $author ) ? $instance['show_author'] : 'no';
$show_excerpt = isset( $instance ['show_excerpt'] ) ? $instance['show_excerpt'] : 'no';
$show_compact = isset( $instance ['show_compact'] ) ? $instance['show_compact'] : 'yes';
echo $before_widget;
if ( $title ) echo $before_title . $title . $after_title;
$args = array(
'posts_per_page' => $items,
'orderby' => 'date',
'ignore_sticky_posts' => 1
);
$args['order'] = 'DESC';
$excluded_cats = yit_get_excluded_categories( 2 );
if ( ! empty( $excluded_cats ) ) {
$args['cat'] = $excluded_cats;
}
$myposts = new WP_Query( $args );
$html = "\n";
if( 'yes' == $show_compact ){
$html .= '<div class="recent-post group compact">' . "\n";
}else{
$html .= '<div class="recent-post group">' . "\n";
}
if ( $myposts->have_posts() ) :
while ( $myposts->have_posts() ) : $myposts->the_post();
$wrapper_class = '';
if( 'yes' == $show_thumb && has_post_thumbnail() ){
$wrapper_class .= ' with-thumb';
}else{
$wrapper_class .= ' without-thumb';
}
if( 'yes' == $date ){
$wrapper_class .= ' with-date';
}else {
$wrapper_class .= ' without-date';
}
$img = '';
if ( has_post_thumbnail() && $show_compact == "no" ) {
$img = yit_image( "size=blog_section", false );
}
elseif ( has_post_thumbnail() && $show_compact == "yes" ){
$img = yit_image( "size=blog_widget_compact", false );
}
$html .= '<div class="hentry-post group clearfix">' . "\n";
$html .= '<div class="post-content">';
if ( $date == "yes" ) {
$html .= '<p class="post-date">';
$html .= '<span class="day">' . get_the_time( 'd' ) . '</span>';
$html .= '<span class="month">' . get_the_time( 'M' ) . '</span>';
$html .= '</p>';
}
if ( $show_thumb == 'yes' && $img != '' ) {
$html .= "<div class=\"thumb-img\">" . $img . "</div>\n";
}
$html .= '<div class="clearfix text ' . $wrapper_class . '">';
if ( strpos( $more_text, "href='#'" ) ) {
$post_readmore = str_replace( "href='#'", "href='" . get_permalink() . "'", str_replace( '"', "'", do_shortcode( $more_text ) ) );
}
else {
$post_readmore = $more_text;
//.........这里部分代码省略.........
示例6: YIT_Icon
echo $delay;
?>
>
<?php
echo $a_before;
echo '<div class="box-icon">';
if ($icon_type == 'theme-icon') {
$icon_data = YIT_Icon()->get_icon_data($icon_theme);
$margin_left = $circle_size != 0 && $layout == 'horizontal' ? $circle_size + 30 : $margin_left;
echo '<span class="icon-circle" style="border-width:' . $border_size . 'px;width:' . $circle_size . 'px; height:' . $circle_size . 'px;border-color: ' . $color_circle . ';">';
$color = $color == '' ? '' : 'color:' . $color;
$icon_size = $icon_size == '' ? '14' : $icon_size;
echo '<span class="icon"><i ' . $icon_data . '" style="' . $color . '; font-size:' . $icon_size . 'px"></i></span>';
echo '</span>';
} elseif (strcmp($icon_custom, '') != 0) {
$image = yit_image("echo=no&src=" . $icon_custom . "&getimagesize=1");
echo '<span class="icon">' . $image . '</span>';
}
echo '</div><div class="box-content" style="margin-left:' . $margin_left . 'px">';
if ($title != '') {
echo '<' . $title_size . '>' . $title . '</' . $title_size . '>';
}
echo $a_after;
?>
<?php
echo wpautop(do_shortcode($content));
?>
<?php
echo '</div>';
?>
</div>
示例7: foreach
echo $desc;
?>
</span>
<ul id="<?php
echo $id;
?>
-extra-images" class="slides-wrapper extra-images ui-sortable clearfix" style="">
<?php
if (!empty($value)) {
foreach ($value as $image_id) {
?>
<li>
<a href="#">
<?php
if (function_exists('yit_image')) {
yit_image("id={$image_id}&size=admin-post-type-thumbnails");
} else {
echo wp_get_attachment_image($image_id, array(80, 80));
}
?>
<input type="hidden" name="<?php
echo $name;
?>
[]" value="<?php
echo esc_attr($image_id);
?>
" />
</a>
<a href="#" title="<?php
_e('Delete image', 'yith-plugin-fw');
?>
示例8: foreach
<ul class="slides">
<?php foreach ( $extra_images as $image_id ) : ?>
<li><?php yit_image( "id=$image_id" );//echo wp_get_attachment_image( $image_id, 'full' ); ?></li>
<?php endforeach; ?>
</ul>
</div>
<script type="text/javascript">
jQuery(document).ready(function($){
$('.extra-images-slider').flexslider({
controlNav: false
});
});
</script>
<?php else: ?>
<?php yit_image( "id=$image_id" );//echo wp_get_attachment_image( $image_id, 'full' ); ?>
<?php endif ?>
<?php endif ?>
</div>
<div class="work-description span8" style="float: <?php echo $image_position ?>">
<h1><?php yit_work_the( 'title' ) ?></h1>
<?php yit_work_the('content'); ?>
</div>
<?php if( ($skills && $skills_label) || $year || $customer || $terms_plain ): ?>
<div class="work-skillsdate span4">
<h4><?php echo yit_work_get('project-label'); ?></h4>
<?php if( ! empty( $skills ) && ! empty( $skills_label ) ): ?><p class="categories paragraph-links"><span class="meta-label"><?php echo $skills_label ?>:</span> <?php echo $skills ?></p><?php endif ?>
<?php if( ! empty( $customer ) ): ?><p class="customer"><span class="meta-label"><?php echo _e('Customer', 'yit') ?>:</span> <?php echo $customer; ?></p><?php endif ?>
<?php if( ! empty( $terms_plain ) ): ?><p class="categories"><span class="meta-label"><?php echo _e('Categories', 'yit') ?>:</span> <?php echo $terms_plain; ?></p><?php endif ?>
示例9: while
$html .= "\n";
$html .= '<div class="recent-post group">' . "\n";
while ($myposts->have_posts()) {
$myposts->the_post();
$html .= '<div class="hentry-post group">' . "\n";
// Show Date
if ($date == 'yes') {
$html .= '<p class="post-date">';
$html .= '<span class="day">' . get_the_time('d') . '</span>';
$html .= '<span class="month">' . get_the_time('M') . '</span>';
$html .= '</p>';
}
// Show Post Thumbnail
if ($showthumb == 'yes') {
if (has_post_thumbnail()) {
$html .= '<div class="thumb-img">' . yit_image("size=blog_thumb&alt=blog_thumb", false) . '</div>' . "\n";
} else {
$html .= '<div class="thumb-img"><img src="' . get_template_directory_uri() . '/images/no_image_recentposts.jpg" alt="No Image" /></div>';
}
$html .= '<div class="text">';
} else {
$html .= '<div class="text without-thumbnail">';
}
// Post Title
$html .= the_title('<a href="' . get_permalink() . '" title="' . get_the_title() . '" class="title">', '</a>', false);
// The Post Content
$html .= '' . yit_content('excerpt', $excerpt_length, $readmore) . '';
/*
if( strpos( $readmore, "href='#'" ) )
$post_readmore = str_replace( "href='#'", "href='" . get_permalink() . "'", $readmore );
else
示例10: jQuery
?>
</ul>
</div>
<script type="text/javascript">
jQuery(document).ready(function($){
$('.extra-images-slider').flexslider({
controlNav: false
});
});
</script>
<?php
} else {
?>
<?php
yit_image("id={$image_id}");
//echo wp_get_attachment_image( $image_id, 'full' );
?>
<?php
}
?>
<?php
}
?>
</div>
<div class="work-description span8" style="float: <?php
echo $image_position;
?>
">
<h1><?php
示例11: yit_portfolio_next_page
/**
* Print Next page div
*
* @return void
* @since 2.0.0
* @author Antonio La Rocca <antonio.larocca@yithems.com>
*/
function yit_portfolio_next_page()
{
global $post;
if (defined('DOING_AJAX') && DOING_AJAX && isset($_REQUEST['post_id'])) {
$post = get_post(intval($_REQUEST['post_id']));
}
$next_post = get_next_post();
if ($next_post == '' || $next_post == null) {
$args = array('orderby' => 'menu_order', 'order' => 'ASC', 'post_type' => $post->post_type);
$posts = get_posts($args);
if (!empty($posts)) {
$next_post = $posts[0];
}
}
$post = $next_post;
setup_postdata($post);
$layout = "big_image";
$attachments = get_posts(array('post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => get_the_ID(), 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC'));
$image_size = YIT_Registry::get_instance()->image->get_size('portfolio_single_big');
$placeholder_size = YIT_Registry::get_instance()->image->get_size('portfolio_single_big_placeholder');
if (!empty($attachments)) {
$min_height = $image_size['height'];
foreach ($attachments as $key => $attachment) {
$image = yit_image("id={$attachment->ID}&size=portfolio_single_big&output=array&echo=0");
$min_height = $image_size['height'] < $image[2] ? $image_size['height'] : $image[2];
}
}
$placeholder = !has_post_thumbnail() ? 'class="placeholder no-featured" style="height: ' . $placeholder_size['height'] . 'px;"' : 'class="placeholder"';
?>
<div id="next" class='slide-tab next-post hidden-content <?php
echo !has_post_thumbnail() ? "no-thumb" : "";
?>
' data-post_id="<?php
the_ID();
?>
">
<div class='big-image'>
<div <?php
echo $placeholder;
?>
>
<div class="placeholder-container">
<?php
yit_image(array('post_id' => get_the_ID(), 'size' => 'portfolio_single_big_placeholder', 'class' => 'img-responsive', 'crop' => true));
?>
<div class="inner">
<div class="info-overlay">
<div class="read-more-label"><?php
_e('VIEW NEXT PROJECT', 'yit');
?>
</div>
<div class="read-more-title"><?php
the_title();
?>
</div>
</div>
</div>
</div>
</div>
<?php
if (!empty($attachments) && count($attachments) > 1) {
?>
<div class="swiper-container swiper-<?php
the_ID();
?>
" data-postid="<?php
the_ID();
?>
" style="max-height: <?php
echo $min_height;
?>
px;">
<div class="swiper-wrapper">
<?php
foreach ($attachments as $key => $attachment) {
?>
<div class="swiper-slide">
<?php
yit_image("id={$attachment->ID}&size=portfolio_single_big&class=img-responsive");
?>
</div>
<?php
}
?>
</div>
<div class="swiper-pagination pagination-post-<?php
the_ID();
?>
"></div>
<div class="swiper-navigation container">
<div class="swiper-direction left"><i class="fa fa-chevron-left"></i></div>
<div class="swiper-direction right"><i class="fa fa-chevron-right"></i></div>
//.........这里部分代码省略.........
示例12: esc_url
<?php
/**
* This file belongs to the YIT Plugin Framework.
*
* This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://www.gnu.org/licenses/gpl-3.0.txt
*/
/**
* Template file for insert an image
*
* @package Yithemes
* @author Francesco Licandro <francesco.licandro@yithemes.com>
* @since 1.0.0
*/
$src = esc_url($src);
$animate = $animate != '' ? ' yit_animate ' . $animate : '';
if (function_exists('yit_image')) {
yit_image("src={$src}&width={$width}&height={$height}&alt={$alt}&class=" . esc_attr($animate . $vc_css));
} else {
echo '<img src="' . $src . '" width="' . $width . '" height="' . $height . '" alt="' . $alt . '" class="' . esc_attr($animate . $vc_css) . '" >';
}
示例13: empty
if (yit_get_option('shop-title-uppercase')) {
$title_class[] = 'upper';
}
$title_class = empty($title_class) ? '' : ' class="' . implode(' ', $title_class) . '"';
yit_detect_span_catalog_image();
//automatically add the classes
if (0 == ($woocommerce_loop['loop'] - 1) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns']) {
$woocommerce_loop['li_class'][] = 'first';
}
if (0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns']) {
$woocommerce_loop['li_class'][] = 'last';
}
if (!is_shop_enabled() || !yit_get_option('shop-view-show-price')) {
remove_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price');
}
$image = yit_image("size=shop_catalog&output=array");
$height = isset($image[2]) ? $image[2] : 0;
//quick view js
do_action('yit_quick_view_load_static');
?>
<li <?php
post_class($woocommerce_loop['li_class']);
if ($woocommerce_loop['view'] == 'list') {
?>
style="min-height: <?php
echo $height;
?>
px;"<?php
}
?>
>
示例14: is_singular
global $post;
$blog_type = is_singular( 'post' ) ? 'single_' . $blog_type : $blog_type;
$attachments = get_posts( array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => null,
'post_parent' => get_the_ID(),
'post_mime_type'=> 'image',
'orderby' => 'menu_order',
'order' => 'ASC'
)
);
$image_type = yit_size_xl( 'blog_' . $blog_type );
$image_size = YIT_Registry::get_instance()->image->get_size( $image_type );
if ( !empty( $attachments ) ):
?>
<div style="visibility: hidden;" class="masterslider ms-skin-default" data-view="flow" data-width="<?php echo $image_size['width'] ?>" data-height="<?php echo $image_size['height'] ?>" data-postid="<?php the_ID() ?>" id="galleryslider-<?php the_ID() ?>">
<?php foreach ( $attachments as $key => $attachment ) : ?>
<div class="ms-slide">
<?php yit_image( "id=$attachment->ID&size=$image_type&class=img-responsive" ); ?>
</div>
<?php endforeach; ?>
</div>
<?php endif ?>
示例15: do_shortcode
<?php
echo do_shortcode(apply_filters('yit-elegant_blog-socials', '[share icon_type="square" title="' . __('Share on', 'yit') . '" socials="facebook, twitter, google, pinterest"]'));
?>
</div>
</div>
<!-- post title -->
<div class="the-content span6">
<div>
<?php
$attachments = get_posts(array('post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => get_the_ID(), 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC'));
if ($attachments) {
$height = 0;
$html = '';
foreach ($attachments as $key => $attachment) {
$image = yit_image("id={$attachment->ID}&size=blog_elegant&output=array");
//wp_get_attachment_image_src( $attachment->ID, 'blog_elegant' );
$html .= $image[0] . PHP_EOL;
$height = $image[2] > $height ? $image[2] : $height;
}
$html = '[images_slider effect="fade" width="0" height="' . $height . '" direction="horizontal" speed="5000"]' . PHP_EOL . $html . '[/images_slider]';
echo do_shortcode($html);
}
if (!is_single()) {
?>
<!-- post content -->
<div class="the-content"><?php
if (is_category() || is_archive() || is_search()) {
if (is_category()) {
if (yit_get_option('posts-categories') == 'excerpt') {
the_excerpt();