How to assign categories to featured posts

Cornerstone was coded in such a way that posts (excerpts) can be called from multiple categories on the home page. To assign the categories you want displayed, simply note the ID associated with its name. Yyou can see this by going to Manage > Categories in your admin panel and hovering over the category name.

Open up index.php and look for the Recently Featured heading. Immediately following that, you’ll see this:

<?php global $post; $myposts = get_posts('numberposts=1&offset=1&category=1');

This says you want one post from the category with the ID of 1, and you also want the post offset by one so it doesn’t duplicate the latest entry. Simply change the ID number to reflect whichever category you want to use for each of the Recently Featured entries.

Note: You must also have a minimum of two entries filed under each category for this to work, because of the offset parameter.

By default Cornerstone displays excerpts from four different categories, but you can have as many as you want. Just copy/paste the code within the “featured_left” or “featured_right” DIV, and change the ID as stated above. Here’s a sample of that code:

<div class="featured_left">
<?php // select the category ID
global $post; $myposts = get_posts('numberposts=1&offset=1&category=1');
foreach($myposts as $post) : setup_postdata($post); ?>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php // display a thumbnail graphic using a custom field
if ( get_post_meta($post->ID, 'lead_img', true) ) { ?>
<div class="recent_lead">
<a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/images/thumbs/<?php echo get_post_meta($post->ID, "lead_img", $single = true); ?>" alt="<?php the_title(); ?>" /></a>
</div>
<?php } ?>
<?php the_content_rss('', TRUE, '', 50); ?>

<!-- link to more posts from corresponding category -->
<p class="category">More in<?php the_category(', '); ?>&raquo;</p>
<?php endforeach; ?>
</div>