PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
webnus-core
/
shortcodes
<?php function deep_webnus_portfolio_carousel( $atts, $content = null ) { extract(shortcode_atts(array( 'type' => '1', 'carousel_count' => '10', 'enable_title' => '', 'enable_content' => '', 'shortcodeclass' => '', 'shortcodeid' => '', 'title' => '', ), $atts)); wp_enqueue_style( 'wn-deep-portfolio-carousel', DEEP_ASSETS_URL . 'css/frontend/portfolio-carousel/portfolio-carousel.css' ); ob_start(); $post_id = get_the_ID(); $shortcodeclass = $shortcodeclass ? $shortcodeclass : ''; $shortcodeid = $shortcodeid ? $shortcodeid : ''; // new Query $args = array( 'post_type' => 'portfolio', 'posts_per_page' => $carousel_count, 'post__not_in' => array( $post_id ), ); $rw_query = new WP_Query( $args ); if ( $enable_title == "enable") { $title_state = 'enable'; } if ( $enable_content == "enable") { $content_state = 'enable'; } ?> <?php if ($type == '1') { ?> <section class="related-works"> <!-- latest-projects (owl-carousel) --> <ul id="portfolio <?php echo $shortcodeid; ?>" class="portfolio-carousel owl-carousel owl-theme <?php echo '' . $shortcodeclass; ?>"> <?php if ( $rw_query->have_posts() ) : while ( $rw_query->have_posts() ) : $rw_query->the_post(); ?> <li class="portfolio-item"> <a class="portfolio-img"> <?php $thumbnail_url = get_the_post_thumbnail_url(); $thumbnail_id = get_post_thumbnail_id(); if( !empty( $thumbnail_url ) ) { if ( !class_exists( 'Wn_Img_Maniuplate' ) ) { require_once DEEP_CORE_DIR . 'helper-classes/class_webnus_manuplate.php'; } $image = new Wn_Img_Maniuplate; // instance from settor class $thumbnail_url = $image->m_image( $thumbnail_id, $thumbnail_url , '591' , '461' ); // set required and get result } elseif ( empty( $thumbnail_url ) ) { $thumbnail_url = DEEP_ASSETS_URL . 'images/no_image_att.jpg' ; } ?> <img src="<?php echo '' . $thumbnail_url ?>" alt="<?php the_title(); ?>"> </a> <div class="bgc-overlay"></div> <h5 class="portfolio-title <?php echo '' . $title_state ?> "><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5> <div class="portfollo-content <?php echo '' . $content_state ?> "><?php echo deep_excerpt(25); ?></div> </li> <?php endwhile; endif; wp_reset_query(); ?> </ul> <!-- end latest-projects --> </section> <!-- end related-works --> <?php } ?> <?php if ($type == '2') { ?> <section class="related-works"> <!-- subtitle --> <div class="portfolio-carousel-subtitle"> <h4 class="subtitle"><?php echo esc_html( $title ); ?></h4> <!-- owl-carousel custom navigation --> <div class="latest-projects-navigation"> <a class="btn prev"><i class="fa wn-fa-angle-left"></i></a> <a class="btn next"><i class="fa wn-fa-angle-right"></i></a> </div> </div> <!-- latest-projects (owl-carousel) --> <ul id="latest-projects-<?php echo esc_attr( $type ); ?>" class="owl-carousel owl-theme"> <?php if ( $rw_query->have_posts()) : while ( $rw_query->have_posts() ) : $rw_query->the_post(); ?> <li class="portfolio-item"> <a class="portfolio-img"> <?php $thumbnail_url = get_the_post_thumbnail_url(); $thumbnail_id = get_post_thumbnail_id(); if( !empty( $thumbnail_url ) ) { if ( !class_exists( 'Wn_Img_Maniuplate' ) ) { require_once DEEP_CORE_DIR . 'helper-classes/class_webnus_manuplate.php'; } $image = new Wn_Img_Maniuplate; // instance from settor class $thumbnail_url = $image->m_image( $thumbnail_id, $thumbnail_url , '300' , '200' ); // set required and get result } elseif ( empty( $thumbnail_url ) ) { $thumbnail_url = get_template_directory_uri() . '/images/no_image_att.jpg' ; } ?> <img src="<?php echo '' . $thumbnail_url ?>" alt="<?php the_title(); ?>"> </a> <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5> <div class="portfolio-meta"><?php echo '<span class="portfolio-date">' . get_the_date() . '</span>'; ?></div> </li> <?php endwhile; endif; wp_reset_query(); ?> </ul> <!-- end latest-projects --> </section> <!-- end related-works --> <?php } ?> <?php $out = ob_get_contents(); ob_end_clean(); $out = str_replace('<p></p>','',$out); return $out; } add_shortcode('portfolio-carousel', 'deep_webnus_portfolio_carousel');
[+]
..
[-] video-teaser.php
[edit]
[-] vcw.php
[edit]
[-] sermon-category.php
[edit]
[-] iconbox.php
[edit]
[-] speakers.php
[edit]
[-] iconfonts-param.php
[edit]
[-] checklist-param.php
[edit]
[-] infobox.php
[edit]
[-] webtags.php
[edit]
[-] teaser-box.php
[edit]
[-] latest-from-blog.php
[edit]
[-] reservation.php
[edit]
[-] subscribe.php
[edit]
[-] progressbar.php
[edit]
[-] review-items.php
[edit]
[-] icon-divider.php
[edit]
[-] toggle-box.php
[edit]
[+]
assets
[-] pie.php
[edit]
[-] asermon.php
[edit]
[-] buttons.php
[edit]
[-] accordion.php
[edit]
[-] testimonial-carousel.php
[edit]
[-] deep-gallery.php
[edit]
[-] custom-menu.php
[edit]
[-] postslider.php
[edit]
[-] magazine.php
[edit]
[-] callout.php
[edit]
[-] maxcounter.php
[edit]
[-] testimonialslider.php
[edit]
[-] testimonials.php
[edit]
[-] wp-hotel-booking.php
[edit]
[-] services.php
[edit]
[-] image-carousel.php
[edit]
[-] category-tab.php
[edit]
[-] slide-up-note.php
[edit]
[-] ourteam.php
[edit]
[-] prayerwall-items.php
[edit]
[-] heading.php
[edit]
[-] tablepress.php
[edit]
[-] instagram.php
[edit]
[-] video-play.php
[edit]
[-] columns.php
[edit]
[-] special-offer.php
[edit]
[-] like-view-share.php
[edit]
[-] image-hotspot.php
[edit]
[-] postfromblog.php
[edit]
[-] roadmap.php
[edit]
[-] search.php
[edit]
[-] recipes.php
[edit]
[-] ourclients.php
[edit]
[-] tab.php
[edit]
[-] blog.php
[edit]
[-] icon.php
[edit]
[-] latest-tweets.php
[edit]
[-] before-after-image.php
[edit]
[-] food-menu.php
[edit]
[-] alerts.php
[edit]
[-] login.php
[edit]
[-] pricing-plan.php
[edit]
[-] dropcap.php
[edit]
[-] rooms.php
[edit]
[-] prayerwall-form.php
[edit]
[-] countdown.php
[edit]
[-] lefttab.php
[edit]
[-] schedule.php
[edit]
[-] block-quote.php
[edit]
[-] highlight.php
[edit]
[-] our-process.php
[edit]
[-] w-title.php
[edit]
[-] shop-products.php
[edit]
[-] buy-process.php
[edit]
[-] portfolio-carousel.php
[edit]
[-] causes.php
[edit]
[-] review-form.php
[edit]
[-] pricingtables.php
[edit]
[-] sermons.php
[edit]
[-] distance.php
[edit]
[-] collection.php
[edit]
[-] donate.php
[edit]
[-] googlemap.php
[edit]
[-] list.php
[edit]
[-] acause.php
[edit]
[-] service-carousel.php
[edit]
[-] quote.php
[edit]
[-] w-svg.php
[edit]
[-] tooltip.php
[edit]
[-] socials.php
[edit]
[-] process-carousel.php
[edit]