I did one on my Pictorialis and called it Film, I am able to call it using <?php the_meta_key("Film"); ?>
So I assume you could call yours with <?php the_meta_key("photo_des"); ?>
?
Ah, sorry about that, I totally spaced. 🙂
You need to have this in your my-hacks.php file:
<?php
function the_meta_key( $tag='') {
global $id, $post_meta_cache;
$inUL = false;
if ($keys = get_post_custom_keys()) {
foreach ($keys as $key) {
if ($key == $tag || $tag=='') {
$values = array_map('trim',$post_meta_cache[$id][$key]);
$value = implode($values,', ');
if (!$inUL) { echo "<ul class='post-meta'>\n"; $inUL = true; }
echo "
Here’s the thread I originally got this from, in case you have issues:
http://wordpress.org/support/3/6283
Why are we required to have a my hacks file for this feature within WP? I would like to avoid having customized files all over the place and never liked the hacks file to begin with (I don’t want to have to create or maintain one for each upgrade, etc.). If Custom Fields is a core part of the new version of WP, shouldn’t there be something we can just put in our templates to make them appear without using another file?
That hack should be added to the WordPress Wiki 🙂
Anonymous
debwire: this can very simply be made a plugin