PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
webnus-core
/
shortcodes
<?php function deep_singlepostfromblog( $attributes, $content = null ) { extract(shortcode_atts( array( 'type' => '1', 'post' => '', 'link_target' => '', 'shortcodeclass' => '', 'shortcodeid' => '', 'hide_cat' => '', 'hide_date' => '', ), $attributes)); wp_enqueue_style( 'wn-deep-post-from-blog', DEEP_ASSETS_URL . 'css/frontend/post-from-blog/post-from-blog.css' ); ob_start(); // Class & ID $shortcodeclass = $shortcodeclass ? $shortcodeclass : ''; $shortcodeid = $shortcodeid ? ' id="' . $shortcodeid . '"' : ''; $hide_cat = $hide_cat == 'true' ? 'true' : 'false'; $hide_date = $hide_date == 'true' ? 'true' : 'false'; $gcolor = '#000' ; static $uniqid = 0; $uniqid++; $link_target_tag = ''; if ( $link_target == 'true' ){ $link_target_tag = ' target="_blank" '; } $query = new WP_Query('p='.$post.''); if ($query -> have_posts()) : $query -> the_post(); $thumbnail_id = get_post_thumbnail_id(); $thumbnail_url = get_the_post_thumbnail_url(); 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 , '690' , '460' ); // set required and get result } if ( $type == 1 ) { ?> <article class="a-post-box-<?php echo esc_html( $type ); ?> <?php echo '' . $shortcodeclass; ?>" <?php echo $shortcodeid; ?>> <figure class="latest-img"><img src="<?php echo esc_html( $thumbnail_url); ?>" alt="<?php the_title(); ?>"></figure> <div class="latest-overlay"></div> <div class="latest-txt"> <h4 class="latest-title"><a href="<?php the_permalink(); ?>" <?php echo '' . $link_target_tag; ?>><?php the_title(); ?></a></h4> <?php if ( $hide_cat != 'true' ) { ?> <span class="latest-cat"><?php the_category(' / '); ?></span> <?php } ?> <?php if ( $hide_date != 'true' ) { ?> <span class="latest-date"><i class="sl-clock"></i> <?php the_time(get_option( 'date_format' )); ?></span> <?php } ?> </div> </article> <?php } if ( $type == 2 ) { ?> <article class="a-post-box-<?php echo esc_html( $type); ?> a-post-box-<?php echo esc_html( $type) . $uniqid; ?> <?php echo '' . $shortcodeclass; ?>" <?php echo $shortcodeid; ?>> <figure class="latest-img"><img src="<?php echo esc_html( $thumbnail_url); ?>" alt="<?php the_title(); ?>" ></figure> <div class="latest-txt"> <?php if ( $hide_cat != 'true' ) { ?> <span class="latest-cat"> <div class="latest-color"></div> <?php the_category(' / '); ?> </span> <?php } ?> <?php if ( $hide_date != 'true' ) { ?> <span class="latest-date"><?php the_time(get_option( 'date_format' )); ?></span> <?php } ?> <h4 class="latest-title"><a href="<?php the_permalink(); ?>" <?php echo '' . $link_target_tag; ?>><?php the_title(); ?></a></h4> </div> </article> <?php $style = '.a-post-box-' . $type . $uniqid . ' .latest-color { background: ' . deep_category_color() . '; }'; deep_save_dyn_styles( $style ); // live editor if ( ! in_array( 'admin-bar', get_body_class() ) ) { if ( ! empty( $style ) ) { echo '<style>'; echo $style; echo '</style>'; } } } endif; $out = ob_get_contents(); ob_end_clean(); wp_reset_postdata(); return $out; } add_shortcode('postblog', 'deep_singlepostfromblog'); ?>
[+]
..
[-] 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]