Skip Navigation

[Resolved] use php to display wpcf

This support ticket is created 2 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 1 voice.

Last updated by tomA-2 2 years, 4 months ago.

Author
Posts
#2448003

I am trying to display my wpcf custom field on a template loop using php.

<?php $venue .= get_post_meta( $event['post_id'], 'wpcf-venue', true ); ?>
<?php $venue_address .= get_post_meta( $event['post_id'], 'wpcf-venue-address', true ); ?>
<p><?php echo esc_html( $venue ); ?></p>
<p><?php echo esc_html( $venue_address ); ?></p>

I searched tickets and documentation and can't find anything that would help. I have no output from this code.

#2448005

<?php $venue = get_post_meta( $event['post_id'], 'wpcf-venue', true ); ?>
<?php $venue_address = get_post_meta( $event['post_id'], 'wpcf-venue-address', true ); ?>
<p><?php echo esc_html( $venue ); ?></p>
<p><?php echo esc_html( $venue_address ); ?></p>

was correct code. I had a "." before the equal sign.