Recent "Press" releases Example
<?php
/*
Template Name: Community Recent Posts Display
*/
?>
<?php $my_query = new WP_Query('posts_per_page=20'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class="recent-post">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" class="bold black">
<span class="press-name"><?php the_title(); ?></span>
</a>
<span class="blog-post-posted-by italic orange">Posted on <?php the_time('F d, Y') ?> by <?php the_author(); ?></span>
<span class="blog-post-text"><?php echo community_excerpt(24); ?><a href="<?php the_permalink(); ?>" class="blog-posts-read-more bold">Read More »</a></span>
</div>
<?php endwhile; ?><mvt:call action="'http://' $ g.domain:name $ '/blog/community-page-recent-posts/'" method="'GET'">
<mvt:eval expr="s.callvalue" />
</mvt:call><?php
// Add to Functions.php
// Community Excerpt -- community_excerpt(25);
function community_excerpt($limit) {
$excerpt = explode(' ', get_the_excerpt(), $limit);
if (count($excerpt)>=$limit) {
array_pop($excerpt);
$excerpt = implode(" ",$excerpt).'...';
} else {
$excerpt = implode(" ",$excerpt);
}
$excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt);
return $excerpt;
} ?><?php
/*
Template Name: Miva Recent Posts Display
*/
?>
<div class="container clearfix">
<div class="row">
<div class="sfnt-dashes">
<h3 class="sfnt-title"><a href="http://www.eventblossom.com/blog/press/">event blossom in the press</a></h3>
</div>
<div class="press-carousel">
<?php $my_query = new WP_Query('post_type=press&posts_per_page=20'); ?>
<?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
<div class="recent-post text-center">
<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<div class="press-image-wrap">
<?php the_post_thumbnail('medium'); ?>
</div>
<span class="press-name"><?php the_title(); ?></span>
</a>
</div>
<?php endwhile; ?>
</div>
</div>
</div>