Forum Moderators: coopster

Message Too Old, No Replies

Custom Field Array

         

WannaKnowSEO

9:47 am on Nov 14, 2008 (gmt 0)

10+ Year Member



Hey all, thanks in advance for your help with this question.

I'm trying to echo a ul/li list of custom fields with the key name "qr". Here's what I've come up with, but it doesn't seem to be working:

<?php
$qr_values = get_post_custom_values('qr');
foreach ( $qr_values as $key => $value ) {
echo "$key => $value ('qr')<br />";
}
?>

I'm basing it on the contents of this page:
[codex.wordpress.org...]

Could anyone help me out?

Thanks again!
- B

WannaKnowSEO

7:11 pm on Nov 14, 2008 (gmt 0)

10+ Year Member



I asked another friend who was able to solve it. If anyone out there has the same question, the answer is:

$gordonsVariable = get_post_meta($post->ID, 'qr', FALSE);
if (sizeof($gordonsVariable) > 0) {
echo "<ul><li>".implode("</li><li>", $gordonsVariable)."</li></ul>";
}