PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
webnus-core
/
shortcodes
<?php function deep_postslider( $attributes, $content = null ) { extract(shortcode_atts(array( 'type' => '1', 'how_number_slide' => '2', 'category' => '', 'shortcodeclass' => '', 'shortcodeid' => '', 'hide_cat' => '', 'hide_date' => '', ), $attributes) ); wp_enqueue_style( 'wn-deep-post-slider0', DEEP_ASSETS_URL . 'css/frontend/post-slider/post-slider0.css' ); wp_enqueue_style( 'wn-deep-post-slider' . $type, DEEP_ASSETS_URL . 'css/frontend/post-slider/post-slider' . $type . '.css' ); ob_start(); // Class & ID $shortcodeclass = $shortcodeclass ? $shortcodeclass : ''; $shortcodeid = $shortcodeid ? ' id="' . $shortcodeid . '"' : ''; $style = ''; echo '<div class="postslider-owl-carousel postslider-' . $type . ' owl-carousel owl-theme ' . $shortcodeclass . '" ' . $shortcodeid . ' data-postslider_count="1">'; switch ( $type ) : case '1': $query = new WP_Query('posts_per_page=' . $how_number_slide . '&category_name=' . $category . ''); static $uniqid = 0; while ( $query->have_posts() ) : $query->the_post(); $uniqid++; $thumbnail_url = get_the_post_thumbnail_url(); $thumbnail_id = get_post_thumbnail_id(); if( !empty( $thumbnail_url ) ) { // if main class not exist get it 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 , '1920' , '1080' ); // set required and get result } ?> <div class="postslider-carousel postslider-a basic"> <figure class="latest-img"> <img src="<?php echo '' . $thumbnail_url; ?>" alt="<?php the_title() ?>" > </figure> <div class="latest-content latest-content-<?php echo '' . $uniqid; ?>"> <?php if ( $hide_cat != 'true' ) { ?> <span class="category"><span class="category-color"></span><?php the_category(', '); ?></span> <?php } ?> <?php if ( $hide_date != 'true' ) { ?> <span class="date"><?php the_time(get_option( 'date_format' ) ); ?></span> <?php } ?> <h3 class="latest-title"><a href=<?php the_permalink(); ?> class="hcolor"><?php the_title(); ?></a></h3> </div> </div> <?php $style .= '.latest-content-' . $uniqid . ' .category-color { background: ' . deep_category_color() . '; }'; endwhile; break; case '2': $query = new WP_Query('posts_per_page=' . $how_number_slide . '&category_name='.$category.''); static $uniqid = 0; while ( $query->have_posts() ) : $query->the_post(); $uniqid++; $thumbnail_url = get_the_post_thumbnail_url(); $thumbnail_id = get_post_thumbnail_id(); if( !empty( $thumbnail_url ) ) { // if main class not exist get it 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 , '1920' , '1080' ); // set required and get result } ?> <div class="postslider-carousel postslider-b new"> <figure class="latest-img"> <img src="<?php echo '' . $thumbnail_url; ?>" alt="<?php the_title() ?>" > </figure> <div class="latest-content latest-content-<?php echo '' . $uniqid; ?>"> <?php if ( $hide_cat != 'true' ) { ?> <span class="category"><span class="category-color"></span><?php the_category(', '); ?></span> <?php } ?> <?php if ( $hide_date != 'true' ) { ?> <span class="date"><?php the_time(get_option( 'date_format' ) ); ?></span> <?php } ?> <h3 class="latest-title"><a href=<?php the_permalink(); ?> class="hcolorf"><?php the_title(); ?></a></h3> </div> </div> <?php $style .= '.latest-content-' . $uniqid . ' .category-color { background: ' . deep_category_color() . '; }'; endwhile; break; case '3': $query = new WP_Query('posts_per_page=' . $how_number_slide . '&category_name='.$category.''); static $uniqid = 0; while ( $query->have_posts() ) : $query->the_post(); $uniqid++; $thumbnail_url = get_the_post_thumbnail_url(); $thumbnail_id = get_post_thumbnail_id(); if( !empty( $thumbnail_url ) ) { // if main class not exist get it 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 , '1214' , '980' ); // set required and get result } ?> <div class="postslider-carousel postslider-b "> <figure class="latest-img"> <img src="<?php echo '' . $thumbnail_url; ?>" alt="<?php the_title() ?>" > </figure> <div class="latest-content latest-content-<?php echo '' . $uniqid; ?>"> <?php if ( $hide_cat != 'true' ) { ?> <span class="category"><span class="category-color"></span><?php the_category(', '); ?></span> <?php } ?> <?php if ( $hide_date != 'true' ) { ?> <span class="date"><?php the_time(get_option( 'date_format' ) ); ?></span> <?php } ?> <h3 class="latest-title"><a href=<?php the_permalink(); ?> class="hcolorf"><?php the_title(); ?></a></h3> <?php $style .= '.latest-content-' . $uniqid . ' .category-color { background: ' . deep_category_color() . '; }'; ?> <p class="excerpt"><?php echo deep_excerpt(25); ?></p> <a href="<?php the_permalink(); ?>" class="magicmore"><i class="icon-arrows-slim-right"></i><?php esc_html_e( 'READ MORE', 'deep' ) ?></a> </div> </div> <?php endwhile; break; endswitch; echo '</div>'; deep_save_dyn_styles( $style ); // live editor if ( ! in_array( 'admin-bar', get_body_class() ) ) { if ( ! empty( $style ) ) { echo '<style>'; echo $style; echo '</style>'; } } $out = ob_get_contents(); ob_end_clean(); $out = str_replace('<p></p>','',$out); wp_reset_postdata(); return $out; } add_shortcode( 'postslider', 'deep_postslider' );
[+]
..
[-] 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]