Over the past week, I've been trying to come up with something I like for Asides. What are asides? Well, here's one definition:
When you lean towards someone and tell them a little bit of information, you are making an "aside" comment. In blogs, you can do that on your blog by passing on small bits of information to your readers called Asides.
The idea is then to present them a bit differently. Originally I was using a plugin that displayed them in the sidebar. Later, I eliminated it and coded a different approach (summarized here). In general, that worked ok but I could never quite get the display to be what I wanted. I was constantly trying to find different ways to present them.
Just to be amusing, in early August I had gone back to the plugin (newer version of it is quite nice) for a bit. Again, worked great -- and wasn't quite what I was after.
I finally realized part of it last weekend: All of my farting around has been with how to show these in the sidebar, how many to show in the sidebar, and should it be the same set visible from everywhere or should the sidebar set change based on the date of the currently viewed post. Well pfft to all that, I say. I was just making crap way too complicated. And frankly, my sidebar needs less stuff, not more stuff.
I've taken the approach of showing asides in the main view of the blog interspersed with all the other posts. (If you read this via RSS, you'll never notice the style differences, just as you haven't up until this point. And that's intentional). The key, this time around, is I've simply hacked up "The Loop" on my theme's index.php a bit. It's really pretty straightforward. A little PHP conditional logic and a bit of CSS and we're off to the races.
Here's a sample of what my theme's index.php has going on now for The Loop:
-
<div id="content">
-
<?php if (have_posts()) : ?>
-
<?php while (have_posts()) : the_post(); ?>
-
<!-- Category 18 is my Asides category. We just change -->
-
<!-- the div class and re-arrange things a bit -->
-
<?php if ( in_category('18') ) { ?>
-
<div class="postAsides" id="post-<?php the_ID(); ?>">
-
<p>
-
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_time(' F jS, Y') ?>
-
</a></p>
-
<div class="entry">
-
<?php the_content('Read the rest of this entry »'); ?>
-
<br />
-
</div>
-
<?php } else { ?>
-
-
<!-- Normal Loop stuff goes here. Theme specific. -->
-
<!-- in other words, just use what you already have -->
-
-
<?php } ?>
-
</div>
-
<?php endwhile; ?>
So, basically, I just wedged in an if statement and displayed the date (which is also the post's permalink -- click it for a normal single post view) and the post. No tags. No nothing. Want to leave a comment? Click the date and comment from there.
I created a new CSS class called "postAsides". I basically just copied my theme's current post class and added a background color. So for my theme that looks like this:
-
.post {
-
margin: 0 0 30px;
-
}
-
.postAsides {
-
margin: 0 0 30px;
-
background-color: #FFFF99;
-
}
I'm not in love with that background color. I think it'll become a gray or off-white soon. Maybe even a bit of a border. Time will tell. But I'm liking this approach much better for the moment.
Hopefully I'm not doing something overly dumb here... but so far I'm preferring this to the other methods I've used.
Possibly Related posts:




I’d noticed you changed how you were doing yours. Asides are an idea I like but one I can’ t get myself to like the execution of either so I just did away with mine. Eventually I’ll come back to them. They fill a need… I just can’t find a way to fill it that I’m happy with either.
Good luck, and you’re right, the color isn’t right yet hehehe
[...] (and I just realized that my new theme doesn’t handle “Asides” the way I want yet…) [...]
[...] as to style the individual post view more to my liking. I also modified the index.php to display my asides style too. And of course, my own title style. Busy busy [...]