Saltar navegación

[Resuelto] use php to display wpcf

This support ticket is created hace 2 años, 11 meses. 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.

Este tema contiene 1 respuesta, tiene 1 mensaje.

Última actualización por tomA-2 hace 2 años, 11 meses.

Autor
Mensajes
#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.