Displaying Custom Fields
-
I have tried so hard to follow the directions for adding custom fields. I am using the default template and only have basic contact details per member, but I have added a field called “Spouse Name”. It has shown on the back-end, but I can’t get it to show on the front end. The only thing that shows is the word ARRAY.
I don’t know PHP so I am sure it’s just a comma or something. This is what I have added to the card.php file that I created:
<div>
<?php
$text = $entry->getMeta(
array(
‘id’ => ‘spouse_id’, // This should match exactly the field id used when registering the custom field.
‘single’ => TRUE // Do not change this.
)
);if ( ! empty( $text ) ) echo ” . esc_html( $text ) . ”;
?>
</div>
- The topic ‘Displaying Custom Fields’ is closed to new replies.