echo get_permalink(); ?> "><?php echo alfath_post_thumbnail($post_id); ?> </a> </figure> <div class="summary-wrap col-xs-12"> <header> <h4 class="entry-title"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h4> </header> <div class="entry-summary"> <?php global $query; if ($query->current_post === 0 && !is_paged()) { the_excerpt(); } ?> <?php echo alfath_agenda_detail(); ?> </div> </div> </article>
/** * Print latest Agenda * @param array $atts shortcode attributes * @return string html code */ function alfath_lastagenda_shortcode($atts) { extract(shortcode_atts(array('number' => 1, 'length' => 30), $atts)); ob_start(); $args = array('order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $number, 'paged' => '1', 'ignore_sticky_posts' => true, 'post_status' => 'publish', 'post_type' => 'agenda'); $query = new WP_Query($args); // The Loop if ($query->have_posts()) { while ($query->have_posts()) { $query->the_post(); $content = '<h4 class="entry-title"><a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a></h4>'; $content .= alfath_agenda_detail(); $content = '<div class="last-agenda col-sm-12 col-xs-12 no-padding bottom-margin">' . $content . '</div>'; // $figure = '<figure class="col-sm-12 col-xs-12 agenda-thumbnail no-padding">' . $thumb .'<figcaption>' . $content . '</figcaption></figure>'; echo $content; } } wp_reset_postdata(); $output = ob_get_clean(); return $output; }