the_field()
directly echoes the contents of a field. If you want to use the_field()
, you should change the field output to url in acf settings panel (Where you created the field).
If you however wish to play around with var_dump()
and return a specific value from an object, you should use get_field('field_name')
.
So in your example, that would look something like this:
<?php
if(get_field('website_image')):
$wimg = get_field('website_image');?>
<img src="https://wordpress.stackexchange.com/questions/287602/<?php echo $wimg["url']; ?>">
<?php endif;?>
Related Posts:
- Media library – Limit images to custom post type
- List events by month
- Issue to get wp_get_attachment_image with cmb2
- “add_post_type_support” with Custom Post Type & ACF
- Adding custom image sizes and post types to a plugin or to a theme?
- Redirect to another page using contact form 7? [closed]
- How to add multiple images to a custom post type without plugin [closed]
- Custom post types, disable fields
- Permalink URL connection between two custom types
- How to show link to product in custom fields?
- How to load custom post type plugin after acf options page (or get settings from there another way)?
- Retrieve a post with its ACF repeater fields in wordpress
- How to replace custom post type slug with an ACF value?
- Custom Post Type | Fatal Error on register_post_type()
- How to insert multiple images into a single post within a CPT
- Set object terms not working on plugin activation
- How to add the post ID (or any other post data) to a Contact Form 7 mail?
- Adding class to featured image
- Change post featured image on hover
- How to create an array for a CPT post ID to use in an IF/WHILE statement
- GravityForm: Populate Dropdown with custom post type [closed]
- Link users to a custom post type
- how to add extra meta box or textarea into custom post types
- Remove duplicated values from a loop
- How to retrieve category NAME instead of ID in a function with a taxonomy custom field?
- Custom Post type with ACF in REST API, how do I get those values?
- ACF simple text field value not showing
- Shortcode insertion in tab
- Post Object Filter by Custom Field, not title (ACF)
- Custom Post Types not showing, custom WP_Query
- Can’t get order_by meta_value_num to work properly
- How to quickly reorder posts in the admin panel that will persist for the wp-api
- Rewrite WordPress URL to show CPT meta field data
- Add CPT as subpage under custom page
- Create 3 Level Relations with ACF and WordPress
- Custom Post type and Custom Field WP_Query
- Display multiple custom post types and sort them chronological by one of their fields
- WooCommerce product search titles only
- check if post title in a custom post type exists in page
- List all images from a single post meta value
- Custom Image Thumbnails of Different Sizes
- How to hack YARPP plugin to find related posts for custom post type?
- How to display Custom Post Type Post based on Tag with Shortcode Parameter?
- Multiple ACF Repeaters within a Custom Post Type
- How to change post featured image using a custom field of category?
- Validate custom fields before save using WordPress Rest API
- Show listings from Impress Listing plugin in random order using taxonomy and terms
- get_posts of Custom Post Type AND Custom Taxonomy
- Update menu when saving settings
- Inserting HTML tag with ACF into shortcode
- How to: Display ACF [fields] on Custom Post Types Utilising WordPress ‘Hooks’? [closed]
- One-to-many post relationships that are displayed by category (using posts-to-posts plugin)
- custom post type not showing in menu
- Custom posts don’t work
- How to move image thumbnails into custom folder for custom post type
- How to retain $_POST data when submitting form to custom page
- Custom fields vs. Custom post types for a Portfolio Website
- Why get_posts() not returning only selected category posts from Custom Post Type?
- single-{cpt}.php ignored
- If post has custom field then display css-class
- Retrieve value of a category’s custom field
- Adding a custom post type taxonomy template in plugin
- Replace text in post from cvs
- Insert and then update post_type by wp_update_post
- How can I dynamically add a post to a custom post type which uses a custom field?
- Problem with WordPress query on page using custom fields
- uploading images to specified directories
- the_content() not outputting anything (Advanced Custom Fields)
- Custom Post Types. Are there any disadvantages/advantages in using a plugin to develop them?
- add category name to permalinks on product page /category-name/product-name
- How can I make a custom post type sticky?
- Get image post ID in media upload
- Link to full size post thumbnail
- Hide editor while keeping add media button in custom post type
- Custom Post Type with image gallery
- Multiple featured sizes / images / excerpts
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- How to Create an Image Upload Box for Custom Posts?
- How to add a post slug to a url?
- Add custom ID to CPT posts only create not update
- Custom Taxonomy terms aren’t getting referenced or saved in Quick Edit or Bulk Edit, only on Single product page?
- WP_Query to select custom post type with Advanced Custom Fields (ACF) date
- Add custom image size for custom post type or taxonomy
- Bulk Update Custom Fields for Custom Post Types
- ACF Field on CPT Slug
- Matching Chapters to a Custom posts [closed]
- WP_Query order by custom field, then randomly order some of results
- Cluster CPT posts to users based on ACF value from their profile on dashboard
- ACF Values Don’t Show After Import Unless I Edit/Update Post
- How to automatically set ‘default image size’ for specific Custom Post Type
- Troubles with acf/save_post and WP_Query
- Query custom post type with ACF Date
- Action or Filter Hook for a Custom Importer
- custom post type WYSIWG removes paragraphs when displayed
- Stuck in Order by more then one
- Custom Post Type + ACF and performance [closed]
- How to set a CPT to have a page as a parent, then rewrite urls accordingly?
- Broken featured images are uploading from frontend
- Meta Query Not Returning Output Despite Having Matching Values
- Addition of custom option panel crashes Media Library & Admin Area