• Hey, I have a bunch of custom fields that I want displayed in a definition list like this, and not the unordered list that is by default:

    <dl>
    <dt>Value</dt>
    <dd>Key</dd>
    </dl>

    I’ve managed to print out the values, but not the keys completely. The keys just come up as ID numbers, like this:

    <dl>
    <dt>Value</dt>
    <dd>1</dd>
    </dl>

    This is my code at the moment:

    $custom_field_keys = get_post_custom_keys();
    
    foreach ( $custom_field_keys as $key => $value ) {
    	$valuet = trim($value);
    	if ( '_' == $valuet{0} )
    	continue;
    	echo "<dt>" . $value . "</dt>" . "<dd>" . $key . "</dd>";
    }

    How would I get the keys to print out their name and not their ID numbers?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Custom fields in definition list’ is closed to new replies.