Using Asides in the Sidebar

Many people like the idea of a side blog, or more formerly, Asides. If you’re one of them you’ll be happy to know Cornerstone has built in support for Asides using the same concept the home page uses to display posts from multiple categories. You don’t need a plugin or create an additional category.

All you have to do is assign whichever category you want to use as a side blog within this line in sidebar.php:

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

This is saying you want one entry displayed from category ID 3. If you already have an Asides category, just look up the corresponding ID number for it in your Manage > Categories admin panel, and make the change in sidebar.php. If not, you can optionally create one.

Next you’ll need to open index.php and look for this line near the top of the page:

<?php $my_query = new WP_Query('showposts=1"&cat=-3"');

Change the 3 to whatever your category ID is for your Asides (or whatever you call it). This ensures your Asides will not appear in the “latest entry” section of the home page whenever you publish a new one, so you can avoid duplicate content.

That’s it! If you’d like to know how to display your Asides on every page (not just index), see this tutorial on conditional tags.