I have enough trouble understanding my Loop, let alone try to explain it! But I can post a snippet or two from it. For example, for posts dealing with plugins, I prefix the post title on home, category and archive pages with the text “Plugin: “. It’s not part of the title or link, just a flag of sorts. What can I say, it amuses me…
Here’s how I do it: First, I select a custom field key called “wp” when composing a plugin post, and add the value “plugin”.
At the start of The Loop (before the title, of course), I have this block of PHP:
<?php
$title_prefix = '';
if($keys = get_post_custom_keys()) :
foreach($keys as $key) :
$values = array_map('trim',$post_meta_cache[$id][$key]);
$value = implode($values,', ');
if('plugin' == $value)
$title_prefix = 'WP Plugin:';
endforeach;
endif;
?>
Notice I ignore the ‘wp’ key here, as I presently don’t use a value of ‘plugin’ for any other custom field key. If I did, I could have run the check like so:
if(('wp' == $key) && ('plugin' == $value))
Finally, $title_prefix is displayed (thanks to the echo command) with the title:
<h3 class="post-title"><?php echo $title_prefix; ?> <a href="<?php the_permalink(); ?>" title="link: <?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
I’ve shown a specific implementation here, but with a little ingenuity you could put something like this to use for unique images or layout features individualized for one or more type of post.