Can't print custom field content

This topic contains 2 replies, has 2 voices, and was last updated by  Willow 6 years, 9 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18528

    Hello again,

    in the front-end submission form I’ve got name and email from advanced fields, and those are automatically populated with the logged-in users’ info. We also need to collect an additional email address (contact person) which may or may not be the event submitter. I’ve tried setting up both another Email and just a plain input field for the email address. Every other field prints ok, but not the email.

        <h3>With any questions related to this event, please contact:</h3>
    

    <?php if ( get_post_meta( get_the_ID(), 'contact_name', true ) ) : ?> <?php echo get_post_meta( get_the_ID(), 'contact_name', true ); ?> <?php endif; ?> <?php if ( get_post_meta( get_the_ID(), 'contact_email', true ) ) : ?> "> <?php get_post_meta( get_the_ID(), 'contact_email', true ); ?> <?php endif; ?>

    Tried renaming the contact_email field to email_address in case the name clashes with something else, but no luck. What am I not seeing here?

    Thanks!

    Willow
    #18531

    You have

    <?php get_post_meta( get_the_ID(), 'contact_email', true ); ?>
    

    instead of

    <?php echo get_post_meta( get_the_ID(), 'contact_email', true ); ?>
    

    🙂

    Stephen Harris
    #18538

    So embarrassing, I clearly need a break.

    Thank you!!!

    Willow
Viewing 3 posts - 1 through 3 (of 3 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.