Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

User:Matt/Matt's Asides for 1.3


Change the 'category(14)' number to the one you have set for your asides.

You will need to style 'ul linklog' in your css. (See below)

  1. In index.php, find this line:
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    Comment it out like this:
    <?php //if (have_posts()) : while (have_posts()) : the_post(); ?>

  2. Right under that, paste this:
    if ($posts)
    function stupid_hack($str)
    return preg_replace('|</ul>\s*<ul class="linklog">|', '', $str);
    foreach($posts as $post)

  3. The next line should be your date call, and straight under that, paste this:
    <?php if ( in_category(14) && !is_single() ) : ?>
    <ul class="linklog">
    <li id="p<?php the_ID(); ?>"><?php echo wptexturize($post->post_content); ?>
    <span><?php comments_popup_link('(0)', '(1)',
    '(%)')?> <a href="<?php the_permalink(); ?>"
    title="Permalink: <?php echo wptexturize(strip_tags(stripslashes($post->post_title), '')); ?>"
    rel="bookmark">¶</a> <?php edit_post_link('(e)'); ?></span></li>
    <?php else: // If it's a regular post or a permalink page ?>

  4. At the bottom of the index, you have this:
    <?php endwhile; else: ?>
    <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>

    Delete those lines

    And instead, paste these lines:
    <?php endif; // end if in category ?>
    echo '<p>Sorry no posts found.</p>';

That should install the 'Asides' hack in 1.3pre-alpha2. Once working, you can delete the commented-out lines.

This is one format for your css, and I only include as much formatting just to illustrate that you have as much control over this as any other element. Change it to suit your page - what I've written here will almost certainly not !
ul.linklog li {
border:1px solid #ff0000;

to change the link behaviour:
ul.linklog li a {

This is also a list, and as it is, will have those lovely bullets next to each item. If you are one of that rare breed with a dislike of those black discs, you have four ways of dealing with it.

  1. Add 'list-style:none;' to the ul.linklog li above.
  2. Add 'list-style:lower greek;' to the same part of the css. Other list-style-types can be found at http://www.w3.org/TR/REC-CSS2/generate.html#lists.
  3. Create a small image of your own, and use that. The syntax is 'list-style-image: url('bug.gif');'
  4. Add something to the code above. An example - in the code above is this line:
    ?php echo wptexturize(
    change that part to read:
    ?php echo '&raquo;&nbsp;'; echo wptexturize(
    That will give you the chevrons like this: »