PATH:
home
/
letacommog
/
supportleta
/
wp-content
/
plugins
/
webnus-shortcodes
/
shortcodes
<?php function easyweb_webnus_latestnews( $attributes, $content = null ) { extract(shortcode_atts( array( 'type'=>'1', 'category'=>'', 'scount'=>'4', 'rcount'=>'2', ), $attributes)); ob_start(); $count = 0; echo '<div class="latestnews'.$type.'">'; $query = new WP_Query('posts_per_page='.$scount.'&category_name='.$category.''); while ($query -> have_posts()) : $query -> the_post(); $image = get_the_image( array( 'meta_key' => array( 'Thumbnail', 'Thumbnail' ), 'size' => 'easyweb_webnus_square' ,'echo'=>false) ); if($type==1){ echo($count == 0)?'<div class="ln-row">':''; echo '<article class="ln-item"><figure class="ln-image">'.$image.'</figure> <div class="ln-content"> <h3><a class="ln-title" href="'.get_the_permalink().'">'.get_the_title().'</a></h3> <p class="ln-date">'.get_the_date().'</p> <a href="'.get_the_permalink().'" class="ln-button">'.esc_html__('Continue Reading','easyweb_webnus_framework').'</a> </div></article>'; $count ++; if($count==$rcount){ echo '</div>'; $count = 0; } }elseif($type==2){ echo '<article class="ln-item"> <div class="ln-date"><div class="ln-day">'.get_the_date('d').'</div><div class="ln-month">'.get_the_date('M').'</div></div> <div class="ln-content"> <h3><a class="ln-title" href="'.get_the_permalink().'">'.get_the_title().'</a></h3> <p class="ln-excerpt">'.easyweb_webnus_excerpt(16).'</p> <a href="'.get_the_permalink().'" class="ln-button magicmore">'.esc_html__('Read More','easyweb_webnus_framework').'</a> </div> </article>'; } endwhile; echo($type==1 && $count != 0)?'</div>':''; echo '</div>'; $out = ob_get_contents(); ob_end_clean(); wp_reset_postdata(); return $out; } add_shortcode('latestnews', 'easyweb_webnus_latestnews'); ?>
[+]
..
[-] ourclients.php
[edit]
[-] pricing-plan.php
[edit]
[-] callout.php
[edit]
[-] icon.php
[edit]
[-] blog.php
[edit]
[-] buy-process.php
[edit]
[-] tab.php
[edit]
[-] distance.php
[edit]
[-] heading.php
[edit]
[-] alerts.php
[edit]
[-] categorybox.php
[edit]
[-] columns.php
[edit]
[-] ministry.php
[edit]
[-] postfromblog.php
[edit]
[-] single-resource-books.php
[edit]
[-] ourteam.php
[edit]
[-] video-bg.php
[edit]
[-] accordion.php
[edit]
[-] title.php
[edit]
[-] portfolio-carousel.php
[edit]
[-] webtags.php
[edit]
[-] slide-up-note.php
[edit]
[-] latest-from-blog.php
[edit]
[-] iconbox.php
[edit]
[-] quote.php
[edit]
[-] iconfonts-param.php
[edit]
[-] subscribe.php
[edit]
[-] list.php
[edit]
[-] buttons.php
[edit]
[-] checklist-param.php
[edit]
[-] maxslider.php
[edit]
[-] teaser-box.php
[edit]
[-] latest-news.php
[edit]
[-] testimonial-carousel.php
[edit]
[-] our-porcess.php
[edit]
[-] lefttab.php
[edit]
[-] flexslider.php
[edit]
[-] icon-divider.php
[edit]
[-] googlemap.php
[edit]
[-] webnus-divider.php
[edit]
[-] tooltip.php
[edit]
[-] highlight.php
[edit]
[-] taglineslider.php
[edit]
[-] pie.php
[edit]
[-] countdown.php
[edit]
[-] maxcounter.php
[edit]
[-] testimonials.php
[edit]
[-] parallax.php
[edit]
[-] doublepromo.php
[edit]
[-] resource-books.php
[edit]
[-] progressbar.php
[edit]
[-] dropcap.php
[edit]
[-] video-play.php
[edit]
[-] blox.php
[edit]
[-] pricingtables.php
[edit]
[-] magicmore.php
[edit]