Change,
<?php $email ?>
to…
<?php echo $email; ?>
as you need to echo the result of what’s held within $email as the function types_render_field would be using return within the function (if you dig into its core) to return the data instead of directly printing it to screen.
<?php $email = types_render_field ("email");
if ( $email ) { ?>
<a href="https://wordpress.stackexchange.com/questions/69227/mailto:<?php echo $email; ?>"><img src="<?php bloginfo( 'template_url' ); ?>/images/icon-email.gif" width="24" height="24" /></a>
<?php } ?>
Related Posts:
- Most efficient way to add javascript file to specific post and/or pages?
- Display all values of custom a field created with ACF on a page
- How to automatically apply woocommerce product title to all product images alt tags?
- If Custom Field is empty don’t display div
- How to display multiple Post meta_key/meta_values by SQL query
- How to make an meta_query optional?
- Add custom field to attachments in a specific category
- How can update custom meta for all posts
- Unique key for each row in a repeater field
- get_post_custom single array
- Make custom field meta not display if there is not data in it
- how to increase custom post value by one most efficiently?
- How can I create a list of page titles from custom meta values?
- Passing the custom field values in the wp_get_current_user array function
- Custom profile field with birthday. Troubles with
- wordpress allow user to edit user profile with custom fields
- Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?
- Store multiple custom field as post meta per post(css, js, html, 2 link) [closed]
- How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
- How to use thumbnail size of image if I’m only using src to get image
- 3 Slashes appear after Apostrophe in custom fields after updating product-site
- auto-populating custom nav with all items from custom post type
- Trying to retrieve post meta
- Automatic Shortcode Creation with Custom Fields [closed]
- How would an if statement surrounding a custom field with two variables (holding values) look like?
- How to combine 2 php functions into one function with a custom field
- Advanced Custom Fields – display label and value only if value entered
- Is it possible to retrieve all posts with a certain value for metadata?
- Saving zero in meta box
- How to check if a PHP string is different than meta field?
- Why does this update_post_meta function not delete the custom field itself?
- Only show image from custom field when present
- Hide Heading if ACF Field is empty
- Custom meta box values are not getting saved for my custom post type
- WP_Query: getting posts where custom field exists
- Creating an image from a custom field
- User Meta Value not echoing despite Var_Dump Showing correct string
- WordPress loop by meta key that is an array? and how loop multiple arrays
- if custom field doesn’t exist, use post thumbnail instead, as image background
- WP All Import / Update stock quantity from multiple XML files
- How to store multiple custom meta box
- Concatenate Custom Field Value & HTML Value
- `update_post_meta` not working anymore
- Unable to render custom field after attempt to generate a list of recent post in page template
- Define category ID using get_post_meta
- Hide a div when a custom field is empty
- Conditional On custom field plugin metabox
- Adding custom url to readmore link using get_permalink()
- Filter unique custom field value based on custom taxonomy category or other custom field
- Display movies that apear this day next
- Add “alt” Attribute to GD Star Rating Tags
- Display background color or image with custom meta box?
- custom header text
- Can ‘Custom Field’ data be inserted into this Short Code?
- Query pulling a single post per month
- Add custom fields from different posts
- Delete images from media library when user deletes an image from ACF Gallery
- Adding a custom meta field with default NULL value which is not selectable
- Order category posts by last word of custom field
- Display custom field value in woocommerce variable product via jQurey
- Products listing check if meta checkbox is checked
- How to update custom fields when post is published?
- Block error message in foreach loop when looping through ACF field
- Hide a div if the fiels is empty
- Inserting a class on before_widget if checkbox is checked
- Where does php code to load data go?
- What is the correct way to search 3 custom fields only in WordPress?
- wp_get_nav_menu_items() with ACF
- Sum All the Post Meta of Published posts of Current Logged in user
- How do I get the value of a current user’s custom field?
- How to display custom field from a gallery thumbnail?
- Getting a value from a custom field from a page that shares a parent with the current page
- Custom fields changes the formatting of metabox input
- Display Content Based on Custom Field Value
- php if, else & custom fields – syntax error
- How can I show only if custom field has content [closed]
- If custom field doesn’t exist, or exists and it’s true show title?
- Custom field in title
- How can I put a custom field as the link of a button shortcode?
- Outputting a custom field in PHP
- Sorting Meta Fields?
- Custom fields randomly stop working
- Where can I find the code for the menu page meta boxes?
- How to echo a different field if another field is empty?
- PHP Puzzle: Unique Styles with PHP loop
- I want Page titles and excerpts to show up on home.php in certain order
- Metadata on the WP_Post object
- Appending an ACF custom field to the page title
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- I want to show image from custom field image on my custom page template
- How do you create a front end form that enables the editing of member-specific custom fields in WordPress?
- Search custom post type posts only by meta fields?
- How to pass value to add_filter wpcf7_form_tag from another function?
- Custom Admin Menu Report for Specific User ID
- ACF number less than comparison not working
- fetch from an external api call and display results in page
- wordpress-plugin (widget) that performs a Neaby-search on the openstreetmap-endpoint: around x find y
- hide “Open in New Tab” checkbox in link field
- Want to add custom post type for facebook feed
- Custom rest fields not loaded in rest api cpt response