How can I get the% values of% of different posts without needing
insert multiple Custom Fields
?
How can I get the% values of% of different posts without needing
insert multiple Custom Fields
?
You can fetch directly from the database:
global $wpdb;
$resultado = $wpdb->get_results( "SELECT id,meta_value from {$wpdb->postmeta} WHERE meta_key = 'key';" );
Use the function:
$ custom_fields = get_post_custom ($ post-> ID);
foreach ($ custom_fields as $ key = > $ value) {
echo $key . " => " . $value . "<br />";
}