Retrieve Custom Fields Individually
-
Hello,
Yes, I am yet another web monkey who knows just enough php to be dangerous and still learning about the powers of wordpress. FYI: I am using wordpress mu 2.8.4.
I am trying to retrieve and show custom fields in my posts but the thing is . . . I want to retrieve them each individually and not all with one statement, allowing me more control over how they view in posts. I found this code in another topic and it works well but, I need to edit it so that I can use it once for each value that I want to retrieve instead of having it retrieve all values with one statement. Can anyone please help me?
[code]
-
<?php
- ";
echo "" . $name . ": ";
$my_custom_field = $custom_fields[$name];
foreach ( $my_custom_field as $key => $value )
echo $value . "
$custom_fields = get_post_custom($post->ID);
$custom_field_keys = get_post_custom_keys();
foreach ( $custom_field_keys as $key => $name ) {
$valuet = trim($name);
if ( '_' == $valuet{0} ){
continue;
}
if ($name != "ratings_users" && $name != "ratings_score" && $name != "ratings_average"){
echo "";
}
}
?>[/code]
Thanks Bunches . . . Lana Banana
- ";
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Retrieve Custom Fields Individually’ is closed to new replies.