John Hesch

Echoing my thoughts and interests

Juan from Chile wrote and asked how I implemented Matt's Asides into my Yadda theme here on johnhesch.com. It was a really easy modification to the index.php file located in the Yadda theme folder.

First create a new category and call it a unique name that will only be used for your mini-posts. I called mine Mini-Links. Then go back to the category section in your admin panel and see what the category ID number was given to the newly created category.

Now open up index.php in the Yadda theme folder and right below the following code

PHP:
  1. <?php while (have_posts()) : the_post(); ?>

add this

PHP:
  1.  
  2. <?php if (in_category(29) && !$single) { ?>
  3. <ul class="asides">
  4. <li><?php echo wptexturize($post->post_content); echo ' '; comments_popup_link('(0)', '(1)', '(%)' ) ?> <?php edit_post_link('(e)','',''); ?></li>
  5. </ul>
  6. <?php } else { ?>
  7.  

What this does is look at the post to see if it's in category 29. (Remember, you need to change this to the correct category ID). If the post is in category 29 then style the post differently then the others.

Right before

PHP:
  1. <?php endwhile; ?>

add the following

PHP:
  1. <?php } ?>

Now open up the CSS file and add the CSS code you want to use to style mini-posts. I'm using the bullet image from the MinimalPlus theme from Thought Mechanics.

CSS:
  1.  
  2. ul.asides {
  3.     margin-bottom: 0px;
  4.     margin-left: 0px;
  5.     padding-left: 20px;
  6. }
  7. ul.asides li {
  8.     list-style: url(http://johnhesch.com/wp-images/bullet.jpg);
  9. }
  10.  

That's it. Now whenever you want to post an Aside just use the appropriate category.

  1. Juan Said,

    Thanks John, now works perfect. :-D

  2. John Said,

    Your welcome!

  3. Vida-blog » Blog Archive » Said,

    [...] Estrenamos asides o miniblog aquí en Vida-blog. Muy contento, tarde algo en incorporarlos. Para hacerlo solo sigue los pasos en John Hesch y tendras los asides listos. [...]

Graytone | Design: Tenant Report