PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
webnus-core
/
shortcodes
<?php function webnus_acause( $attributes, $content = null ) { extract(shortcode_atts( array( 'post' => '', 'shortcodeclass' => '', 'shortcodeid' => '', ), $attributes)); ob_start(); $shortcodeclass = $shortcodeclass ? $shortcodeclass : ''; $shortcodeid = $shortcodeid ? ' id="' . $shortcodeid . '"' : ''; $args = array( 'post_type' => 'cause', 'posts_per_page' => 1, 'p' => $post, ); $query = new WP_Query($args); ?> <div class="container causes single-cause <?php echo ' ' . $shortcodeclass; ?>" <?php echo $shortcodeid; ?>> <?php while ($query -> have_posts()) : $query -> the_post(); $post_id = get_the_ID(); $cats = get_the_terms( $post_id , 'cause_category' ); if(is_array($cats)){ $cause_category = array(); foreach($cats as $cat){ $cause_category[] = $cat->slug; } }else $cause_category=array(); $cats = get_the_terms($post_id, 'cause_category' ); $cats_slug_str = ''; if ($cats && ! is_wp_error($cats)) : $cat_slugs_arr = array(); foreach ($cats as $cat) { $cat_slugs_arr[] = '<a href="'. get_term_link($cat, 'cause_category') .'">' . $cat->name . '</a>'; } $cats_slug_str = implode( ", ", $cat_slugs_arr); endif; $category = ($cats_slug_str)?esc_html__('Category: ','deep') . $cats_slug_str:''; $date = get_the_time('F d, Y'); $permalink = get_the_permalink(); $image = get_the_image( array( 'meta_key' => array( 'thumbnail', 'thumbnail' ), 'size' => 'sermons-gridmons-grid','echo'=>false, ) ); $image2 = get_the_image( array( 'meta_key' => array( 'thumbnail', 'thumbnail' ), 'size' => 'blog2_thumb','echo'=>false, ) ); $title = '<h4><a class="cause-title" href="'.$permalink.'">'.get_the_title().'</a></h4>'; $content ='<p>'. deep_excerpt(64) .'</p>'; $view = '<div class="cause_view"><i class="wn-far wn-fa-eye"></i>'.deep_getViews($post_id).'</div>'; $deep_options = deep_options(); global $cause_meta; $progressbar = $cause_days = $cause_donate = ''; $received = $percentage = 0; $progressbar = $cause_days = $cause_donate = ''; $received = $percentage = 0; $received = rwmb_meta( 'deep_cause_amount_received' ); $amount = rwmb_meta( 'deep_cause_amount' ); $end = rwmb_meta( 'deep_cause_end_date' ); $deep_options['webnus_cause_currency'] = isset( $deep_options['webnus_cause_currency'] ) ? $deep_options['webnus_cause_currency'] : ''; $currency = esc_html($deep_options['webnus_cause_currency']); if( $amount ) { $percentage = ($received/$amount)*100; $percentage = round($percentage); $out=$currency.$received.esc_html__(' RAISED OF ','deep').$currency.$amount; if ( is_plugin_active( 'js_composer/js_composer.php' ) ) { $progressbar = do_shortcode('[vc_pie value="'.$percentage.'" color="btn-warning" el_class="single-cause-pie" units="%" title="'.$out.'"]'); } elseif ( is_plugin_active( 'kingcomposer/kingcomposer.php' ) ) { $options = ''; $options = '{"1":{"label":" ","value":"'.$percentage.'","value_color":"","prob_color":""}}'; $options = base64_encode ( $options ); $progressbar = $out . do_shortcode('[kc_progress_bars speed="2000" class="single-cause-pie" options="'.$options.'" _id="980293" style="1"]'); } } $now = date('Y-m-d 23:59:59'); $now = strtotime($now); $end_date = $end.' 23:59:59'; $your_date = strtotime($end_date); $datediff = $your_date - $now; $days_left = floor($datediff/(60*60*24)); $date_msg = ''; if($days_left==0) {$date_msg = '1';} elseif($days_left<0) {$date_msg = 'No';} else {$date_msg = $days_left+'1'.'';} $cause_days = ($percentage<100)?'<span>'.$date_msg.'</span> '.esc_html__('Days left to achieve target','deep'):esc_html__('Thank You','deep'); echo '<article class="container"><div class="cause-content row">'; echo '<div class="cause-progress col-md-4 col-sm-4">'.$progressbar.'</div>'; echo '<div class="col-md-8 col-sm-8">'.$title.$content; $deep_options['webnus_donate_form'] = isset( $deep_options['webnus_donate_form'] ) ? $deep_options['webnus_donate_form'] : ''; if($days_left>=0 && $percentage<100 && $deep_options['webnus_donate_form']){ echo deep_modal_donate(); }else{ echo '<p class="cause-completed">'.esc_html__('Has been completed','deep').'</p>'; } echo '<p class="cause-days">'.$cause_days.'</p></div></div></article>'; endwhile; $out = ob_get_contents(); ob_end_clean(); wp_reset_postdata(); return $out; } add_shortcode('acause', 'webnus_acause'); ?>
[+]
..
[-] 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]