Ejemplo n.º 1
0
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 ?>
Ejemplo n.º 2
0
 *
 * 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
 */

global $post;
$terms                  = $portfolio->terms_list( ', ' );
$previous_post          = get_adjacent_post( false, '', true );
$next_post              = get_adjacent_post( false, '', false );
$previous_post_terms    = is_object( $previous_post ) ? yit_get_terms_list_by_id( $previous_post->ID,$taxonomy ) : false;
$next_post_terms        = is_object( $next_post )     ? yit_get_terms_list_by_id( $next_post->ID, $taxonomy ) : false;
$post_attachment_id     = get_post_thumbnail_id();

$featured_image_size    = apply_filters( 'yit_portfolio_single_image_size', ( $is_lookbook ? yit_size_xl('portfolio_single_big_lookbook') : yit_size_xl('portfolio_single_big_featured') ) );

?>

<div id="post-<?php the_ID(); ?>" <?php post_class( 'portfolio_' . $layout ) ?> >
    <div class="meta clearfix portfolio single">
        <div id="portfolio_nav">
            <!-- PREV -->
            <?php if( ! empty( $previous_post ) ) : ?>
                <a href="<?php echo get_permalink( $previous_post->ID ); ?>" rel="prev">
                    <span class="icon-wrap shade-3"><?php _e( 'Prev', 'yit' ) ?></span>
                    <div class="prev-post">
                        <?php echo get_the_post_thumbnail( $previous_post->ID, 'portfolio_thumb', array( 'class' => 'img-responsive portfolio_thumb' ) );; ?>
                        <div class="info shade-2">
                            <h5 class="prev_title"><?php echo $previous_post->post_title ?></h5>
                            <span class="prev_terms"><?php echo $previous_post_terms ?></span>
Ejemplo n.º 3
0
    /**
     * widget function.
     *
     * @see WP_Widget
     * @access public
     * @param array $args
     * @param array $instance
     * @return void
     */
    function widget($args, $instance) {
        global $woocommerce;

        ob_start();

        extract($args);

        $title = apply_filters('widget_title', empty($instance['title']) ? __('Featured Products', 'yit') : $instance['title'], $instance, $this->id_base);
        if ( !$number = (int) $instance['number'] )
            $number = 10;
        else if ( $number < 1 )
            $number = 1;
        else if ( $number > 15 )
            $number = 15;

        $query_args = array('posts_per_page' => $number, 'orderby' => 'rand', 'no_found_rows' => 1, 'post_status' => 'publish', 'post_type' => 'product' );

        $query_args['meta_query'] = array();

        $query_args['meta_query'][] = array(
            'key' => '_featured',
            'value' => 'yes'
        );
        $query_args['meta_query'][] = $woocommerce->query->stock_status_meta_query();
        $query_args['meta_query'][] = $woocommerce->query->visibility_meta_query();

        $r = new WP_Query($query_args);

        if ($r->have_posts()) : ?>

            <?php echo $before_widget; ?>
            <div class="clearfix widget featured-products">
                <?php if ( $title ) echo '<h3>' . $title . '</h3>'; ?>
                <ul class="clearfix products-slider featured-products-slider slides">
                    <?php while ($r->have_posts()) : $r->the_post(); global $product; ?>
                        <li class="clearfix">
                            <?php if( has_post_thumbnail() ) : ?>
                                <?php if( $instance['link_thumbnail'] ) : ?>
                                    <a href="<?php echo esc_url( get_permalink( $r->post->ID ) ); ?>" class="product_img" title="<?php echo esc_attr($r->post->post_title ? $r->post->post_title : $r->post->ID); ?>">
                                        <?php the_post_thumbnail( yit_size_xl( 'featured_product_widget' ) ) ?>
                                    </a>
                                <?php else : ?>
                                    <?php the_post_thumbnail( yit_size_xl( 'featured_product_widget' ) ) ?>
                                <?php endif ?>
                            <?php endif ?>
                            <div class="info-featured-product">
                                <div>
                                    <a href="<?php echo esc_url( get_permalink( $r->post->ID ) ); ?>" class="product_name" title="<?php echo esc_attr( $r->post->post_title ? $r->post->post_title : $r->post->ID ); ?>">
                                        <?php if ( $r->post->post_title ) {
                                            echo get_the_title( $r->post->ID );
                                        }
                                        else {
                                            echo $r->post->ID;
                                        } ?>
                                    </a>

                                    <div class="price"><?php echo $product->get_price_html(); ?></div>
                                </div>
                            </div>
                        </li>
                    <?php endwhile; ?>
                </ul>
            </div>
            <?php echo $after_widget; ?>

        <?php endif;

        $content = ob_get_clean();

        $slider_fx = isset( $instance['slider_fx'] ) ? $instance['slider_fx'] : 'fade';
        $slider_speed_fx = isset( $instance['slider_speed_fx'] ) ? $instance['slider_speed_fx'] : 300;
        $slider_timeout_fx = isset( $instance['slider_timeout_fx'] ) ? $instance['slider_timeout_fx'] : 8000;

        $script = '<script type="text/javascript">
		                jQuery(document).ready(function($){
		                	"use strict";

		                	var animation = $.browser.msie || $.browser.opera ? "fade" : "' . $slider_fx . '";
		                    $(".widget.featured-products").flexslider({
		                        animation: animation,
		                        slideshowSpeed: ' . $slider_timeout_fx . ',
		                        animationSpeed: ' . $slider_speed_fx . ',
		                        selectors: ".slides > li",
		                        directionNav: true,
		                        slideshow: true,

                                prevText: "",
                                nextText: "",

		                        pauseOnAction: false,
						        controlNav: false,
						        touch: true,
						     });
					    });
		            </script>';

        if ( isset( $args['widget_id'] ) ) $cache[$args['widget_id']] = $content;

        echo $content, $script;


        wp_reset_postdata();
    }
Ejemplo n.º 4
0
$tags_icon               = ( $tags_icon_type == 'none' ) ? false : ( ( $tags_icon_type == 'icon' ) ? '<i class="fa fa-' . $tags_icon_options['icon'] . '"></i>' : 'style="background: transparent url(' . yit_ssl_url( $tags_icon_options['custom'] ) . ') top left no-repeat"' );
$tags_icon_class         = ( $tags_icon_type == 'none' ) ? 'without-icon' : ( ( $tags_icon_type == 'custom' ) ? 'with-icon' : 'with-icon awesome' );

$read_more_text          = yit_get_option( 'blog-read-more-text' ) != '' ? yit_get_option( 'blog-read-more-text' ) : __( 'Read More', 'yit' );

echo '<div class="yit_shortcodes recent-post group ' . esc_attr( $animate . $vc_css ) . '" ' . $animate_data . '>' . '<div class="row">';

if ( $myposts->have_posts() ) : while ( $myposts->have_posts() ) : $myposts->the_post();
    $has_tags   = ( ! get_the_tags() ) ? false : true;    ?>

    <div id="post-<?php the_ID(); ?>" <?php post_class( array( $bootstrap_col_class) ); ?>>
        <div class="meta clearfix blog small">
            <div class="small post-wrapper">
                <?php if( has_post_thumbnail() && $showthumb != 'no' ) :
                    $img ='';
                    $img = yit_image( "size=" . yit_size_xl( 'blog_small' ) , false );
                    ?>
                    <div class="thumbnail small">
                        <a href="<?php the_permalink() ?>">
                            <?php echo $img; ?>
                            <div class="yit_post_format_icon"><?php echo ( ! get_post_format() ) ? 'standard' : get_post_format() ?></div>
                        </a>
                        <?php  if ( $date == "yes" ): ?>
                            <div class="yit_post_meta_date">
                                <span class="day"><?php the_time( 'd' ) ?></span>
                                <span class="month"><?php the_time( 'M' ) ?></span>
                            </div>
                        <?php endif; ?>
                    </div>
                <?php endif; ?>
Ejemplo n.º 5
0
                foreach ( $portfolio->terms_array() as $term ) {
                    $classes .= " " . $term->slug;
                }
            }

            ?>
            <li <?php $portfolio->item_class( $classes )?> >
                <div class="info">
                    <?php if( $info_box_location == 'top' ) : ?>
                        <?php include( $info_box_template ) ?>
                    <?php endif; ?>
                    <?php if( $enable_thumbnail ) : ?>
                        <div class="portfolio-thumb">
                            <?php

                            $image = $portfolio->get_image( yit_size_xl('portfolio_small'), array( 'class' => 'img-responsive' ) );
                            
                            if ( strcmp( $image, '' ) != 0 ) {
                                echo $image;
                            } else{
                                ?>
                                <img src="<?php echo $portfolio->get( 'baseurl' ) ?>images/no-image.jpg" class="img-responsive" />
                                <?php
                            }?>
                            <div class="portfolio-overlay">
                                <span class="details">
                                    <?php if( has_post_thumbnail() ) : ?>
                                        <?php $image_uri = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );?>
                                        <?php ! empty( $image_uri ) && is_array( $image_uri )? $image_uri[0] : '#'; ?>
                                        <a class="portfolio-icon yi-icon-lens" rel="prettyPhoto" href="<?php echo $image_uri[0] ?>"></a>
                                    <?php endif; ?>
Ejemplo n.º 6
0
                        <?php endif ?>

                    </div>


                    <?php if( has_post_thumbnail( $member->ID ) && is_rtl() ): ?>
                        <div class="thumb">
                            <?php
                            if( function_exists( 'yit_image' ) ){
                                yit_image( array(
                                    'post_id' => $member->ID,
                                    'size' => yit_size_xl( 'thumb_team_big' )
                                ) );
                            }
                            else{
                                echo get_the_post_thumbnail( $member->ID, yit_size_xl( 'thumb_team_big' ) );
                            }
                            ?>
                        </div>
                    <?php endif; ?>

                    </div>

                </div>
            <?php endforeach; ?>
        </div>

    <?php
    endif;
endif;
?>