function woocommerce_slider() { $posts_per_page = themeple_post_meta(themeple_get_post_id(), 'slides_number'); $args = array('post_type' => 'product', 'posts_per_page' => $posts_per_page, 'orderby' => 'date', 'order' => 'DESC'); $loop = new WP_Query($args); $this->slide_number = 5; global $woocommerce; $items_in_cart = array(); if ($woocommerce->cart->get_cart() && is_array($woocommerce->cart->get_cart())) { foreach ($woocommerce->cart->get_cart() as $cart) { $items_in_cart[] = $cart['product_id']; } } $output = ''; $output .= '<div class="swiper-container swiper-parent swiper_slider" data-slidenr="5">'; $output .= ' <div class="pagination pagination-parent"></div>'; $output .= ' <div class="swiper-wrapper">'; while ($loop->have_posts()) { $loop->the_post(); global $product; $in_array = in_array($product->id, $items_in_cart); $output .= '<div class="swiper-slide woocommerce-slide product ' . ($in_array ? 'product_added_to_cart' : '') . '" style="background-image:url(' . themeple_image_by_id(get_post_thumbnail_id(), "shop_catalog", 'url') . '); background-repeat:no-repeat; -webkit-background-size: cover;-moz-background-size: cover;-o-background-size: cover;background-size: cover;" >'; $output .= '<div class="overlay">'; if ($in_array) { $output .= '<span class="loading_ef"><i class="moon-checkmark"></i></span>'; } else { $output .= '<span class="loading_ef"><i class="icon-spin moon-spinner-2" aria-hidden="true"></i></span>'; } $output .= '<div class="center-bar">'; $output .= '<a href="#" class="link a0 add_to_cart_button button product_type_simple" data-product_id="' . $product->id . '" data-product_sku="' . $product->get_sku() . '" data-animate="zoomIn"><i class="moon-cart"></i></a></a>'; $output .= '<a href="' . get_permalink() . '" class="link a0" data-animate="zoomIn"><i class="moon-list-3"></i></a></a>'; $output .= '<h5>' . get_the_title() . '</h5>'; $output .= '<span class="price">' . $product->get_price_html() . '</span>'; $output .= "</div>"; $output .= '</div>'; $output .= '</div>'; } $output .= ' </div>'; $output .= ' </div>'; $output .= '</div>'; return $output; }
<?php } elseif (get_post_thumbnail_id()) { ?> <img src="<?php echo themeple_image_by_id(get_post_thumbnail_id(), 'blog', 'url'); ?> " alt=""> <?php } ?> <?php if (!is_single()) { ?> <div class="overlay he-view"> <div class="bg a0" data-animate="fadeIn"> <div class="center-bar v1"> <a href="<?php echo get_permalink(); ?> " class="link a0" data-animate="zoomIn"><i class="moon-<?php echo $icon_class;
<?php if ($item_grid_class == 12) { ?> <img src="<?php echo themeple_image_by_id(get_post_thumbnail_id(), 'port1', 'url'); ?> " alt=""> <div class="shape"></div> <?php } ?> <div class="overlay he-view"> <div class="bg a0" data-animate="fadeIn"> <div class="center-bar v1"> <a href="<?php echo themeple_image_by_id(get_post_thumbnail_id(), array("width" => 1200, "height" => 1200), "url"); ?> " class="link a0 lightbox-gallery lightbox" data-animate="zoomIn"><i class="moon-search-3"></i></a></a> <a href="<?php echo get_permalink(); ?> " class="link a0" data-animate="zoomIn"><i class="moon-link-4"></i></a></a> </div> </div> </div> </div>
function great_gallery($element) { extract($element['saved'][0]); $output = '<div class="span' . $dynamic_size . ' great_gallery animate_onoffset">'; $query_post = array('posts_per_page' => 12, 'post_type' => 'gallery'); $additional_loop = new WP_Query($query_post); $output .= '<div class="slideshows row">'; $nav_output = ''; if ($additional_loop->have_posts()) { while ($additional_loop->have_posts()) { $additional_loop->the_post(); $output .= do_shortcode('[lightbox image_link="' . themeple_image_by_id(get_post_thumbnail_id(), 'great_gallery', 'url') . '"]'); } } $output .= '</div>'; $output .= '</div>'; return $output; }
<?php } elseif (get_post_thumbnail_id()) { ?> <img src="<?php echo themeple_image_by_id(get_post_thumbnail_id(), 'port1_list', 'url'); ?> " alt=""> <?php } ?> <?php if (!is_single()) { ?> <div class="overlay he-view"> <div class="bg a0" data-animate="fadeIn"> <div class="center-bar v1"> <a href="<?php echo get_permalink(); ?> " class="link a0" data-animate="zoomIn"><i class="moon-<?php
function themeple_sc_recent_portfolio($atts, $content = null, $shortcodename = "") { extract(shortcode_atts(array(), $atts)); $output = '<div class="pagination"><a href="" class="prev" title="Previous"></a><a href="" class="next" title="Next"></a></div>'; $output .= '<div class="recent_sc_portfolio">'; $posts = get_posts('posts_per_page=18&post_type=portfolio'); if ($posts) { foreach ($posts as $post) { $id = $post->ID; $output .= '<div class="portfolio_sc_item">'; $output .= '<a href="' . get_permalink($id) . '"><img src="' . themeple_image_by_id(get_post_thumbnail_id($id), 'recent_sc_portfolio', 'url') . '" alt=""></a>'; $output .= '</div>'; } } $output .= '</div>'; return $output; }