jeudi 5 novembre 2015

I am trying to display the Label and the value of a custom field type in wordpress

Vote count: 0

I have created a custom post type which contains multiple custom fields.

I am trying to display the Label (not the field name) and the Value of each of the custom fields on the post.

So on the front-end display it would show

Self Catering: Yes

Weddings: Yes

ect ect...

I am trying this code without much luck throwing an error.

<?php 
   $field_name = "self_catering";
   $field = get_field_object($field_name);
   echo '<b>' . $field['label'] . ':</b> ' . $field['value'];
?>

Hope someone can shed some light.

Thanks

asked 3 mins ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



I am trying to display the Label and the value of a custom field type in wordpress

Aucun commentaire:

Enregistrer un commentaire