I would post this as an issue, but since it involves a lot of different facets of the drupal world, I don't think that it necessarily fits in any one category.

Here's my deal:

I am customizing the Zen theme for use with my website and I have a blog set up with the usual blog module. I want to be able to provide a "signature" of sorts that is basically a background image at the end of the post. Every user's blog on my site will have their own signature.

To do this, I created the file node-blog.tpl.php with the default code in it and added the following to the content div:

   <div class="content">
       <?php print $content ?>
       <div id="blog-signature">
           <span class="<?php print theme('userplain',$node); ?>"></span>
       </div>
   </div>

I created the function zen_userplain() in my template.php file which simply outputs the name of the user who created the blog to link it to the span css class. It is simply:

function zen_userplain($object) {
  
  if ($object->uid && $object->name) {
    // Shorten the name when it is too long or it will break many tables.
    if (drupal_strlen($object->name) > 20) {
      $name = drupal_substr($object->name, 0, 15) .'...';
    }
    else {
      $name = $object->name;
    }
  }
  $output = check_plain(strtolower($name));
  
  return $output;
}

This way I can use CSS to insert each user's signature.

Now, to the interesting problem. This code works exactly how I want it for every user and for almost all of the blog posts, except the most recent blog post for every user. That seems really strange to me!

When I view the page source, the blog-signature div block doesn't even show up in the html. It's like PHPTemplate (maybe) is just skipping over it, but only for the most recent blog posting. Isn't that weird?

If anyone has experienced stuff like this before, please share. If you know what the deal is, please share as well!