I don’t care for them myself, but I just got this working for Danithew, so I figured I’d post the method:
In index.php, find this line:
<?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
Comment it out like this:
<?php // if ($posts) : foreach ($posts as $post) : start_wp(); ?>
Right under that, paste this:
<?php
if ($posts) {
function stupid_hack($str) {
return preg_replace('|</ul>s*<ul class="linklog">|', '', $str);
}
ob_start('stupid_hack');
foreach($posts as $post) { start_wp();
?>
The next line should be your date call, and straight under that, paste this:
<?php if (in_category(14) && !$single) { ?>
<ul class="linklog">
<li><?php echo wptexturize($post->post_content); echo ' '; comments_popup_link('(0)', '(1)', '(%)' ) ?></li>
</ul>
<?php } else { ?>
Now scroll down, until you see this:
<?php endforeach; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
Comment those lines out too – like this:
<?php // endforeach; else: ?>
<p><?php //_e('Sorry, no posts matched your criteria.'); ?></p>
<?php // endif; ?>
And instead, paste these lines:
<?php } // end if in category ?>
<?php } } else {
echo '<p>Sorry no posts found.</p>';
}
?>
That should install the ‘Asides’ hack.
NOTE !
1 – BACKUP YOUR INDEX.PHP FIRST
2 – Change the ‘category(14)’ number to the one you have set for your asides.
3 – You will need to style ‘ul linklog’ in your css.
=========
Edit: This has been posted to my ISP space, and is mirrored here as well. Links in the menu.
What is the asides hack….example of it running anywhere?
Check out Matt’s site – he’s the guy behind WP
http://photomatt.net
It’s just like a linklong (like my recent links) only that get shown on the main page.
http://www.weblogtoolscollection.com/ uses them too.
Good post.
I like using ‘asides’ because sometimes I just want to post something and add a couple of words as comment. I like to think of it as not needing a full blown post…but needing a little more than just a link.
I remember it was a pain to put in…but can’t remember exactly why. At least now I know where to point people if they ask how to do it 🙂
<?php // if ($posts) : foreach ($posts as $post) : start_wp(); ?>
could as well be:
//<?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
since the next line has a
<?php to begin with.
Thanks again Mark. It was a great help to have you doing that for me this morning. I really hope that people can take advantage of your clear directions and get it to work more easily in the future.
I tried commenting out a line or two like that, and I kept getting ‘..’ appear on the page and an error.
Probably me breaking it, so I just copied how it was done for popup comments 🙂
This definitely fits the definition of a ‘hack’ ;).
If it were me, I’d prefer to implement some basic logic in index.php rather than using text processing on an output buffer to achieve this. Should be faster and harder to break. But you’ll run into some slightly hairy problems if you still want to use an unordered list rather than just a seperate class of divs…