Passer la navigation

[Résolu] use php to display wpcf

This support ticket is created Il y a 2 années et 12 mois. 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.

Ce sujet contient 1 réponse, a 1 voix.

Dernière mise à jour par tomA-2 Il y a 2 années et 12 mois.

Auteur
Publications
#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.