I love cheese. I always have and always will. Now I have even more reason to love cheese, and that is Hill’s Fine Cheeses! I had some aged Gouda from them last weekend and I just about drooled on myself it was so good. Think […]
Month: May 2008
The plug-in displays 4 posts from a specific category.
The plug-in needs 3 parameters or you could just modify the code to not use them.
Usage: get_me_4_from_cat($category_id, $postmeta_key, $postmeta_value);
This was written to get 4 random events from a specific post category.
The addition of the postmeta variables enables an additional check for the event since posts weren’t being deleted. This example is based on the 2 digit year the event occurs in. (e.g. For 2008 one would put in ’08’ in the string for the function) The custom field key ‘year’, with this configuration, is added to the post and 08 is added for its value. This can be adapted to any postmeta key/value pair.
Example of use in Theme File:
<?php $randomPosts = get_me_4_from_cat(24, ‘year’, ’08’);
foreach ($randomPosts as $post):
<a href=”<?php the_permalink() ?>” rel=”bookmark”>
<?php the_title(); ?>
<?php the_excerpt(); ?>
<a href=”<?php the_permalink() ?>” class=”moreSpot” title=”Read More”>
else : ?>
<h2> Not Found</h2>
<?php endif; ?>
You can download the plug-in file here.
Wow look at me go! I just uploaded a new set of pictures… ok, so really 201 pictures. I guess I’ve been slacking lately. And yes, I know some of them are crappy. What’s the point of taking pictures if some don’t turn out. Geesh! That’s the problem with digital cameras, photos are too easy to delete.