Skip to content

Instantly share code, notes, and snippets.

@brichards
Created February 5, 2014 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brichards/d7d03843d0e419542b6b to your computer and use it in GitHub Desktop.
Save brichards/d7d03843d0e419542b6b to your computer and use it in GitHub Desktop.
Sample
<div id="clearer"></div>
<div id="beforefooter">
<?php
if ( is_page( array( 'legal-services', 'employee-benefits', 'legal-update' ) ) ) {
$recent_posts = wp_get_recent_posts( array(
'numberposts' => 2,
'category' => 3,
) );
foreach ( $recent_posts as $recent_post ) {
setup_postdata($post);
?>
<div class="poster">
<h3>Latest Legal News</h3>
<p class="feat_headline">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</p>
<p>
<?php the_excerpt(); ?>
<a href="<?php the_permalink(); ?>">read more</a>
</p>
</div>
<?php
}
wp_reset_postdata();
}
?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment