Simply you need to replace the_field('video')
with get_field('video')
.
Why?
Because according to ACF documentation;
get_field($field_name, $post_id, $format_value)
Returns the value of the specified field.
Whereas on the other hand
the_field($field_name, $post_id)
Displays the value of the specified field. (this is the same as “echo get_field($field_name)”)
Hope this might help others as well.
Related Posts:
- Redirect to another page using contact form 7? [closed]
- IF Custom field value equals ZERO
- Shortcode for Custom Field of Media Attachment (to use with Featured Images)
- Advanced Custom Fields: how do I check to see if a value is set in an field? [closed]
- Advanced Custom Fields – Get custom fields from parent page
- Add custom field to the archive page?
- Matching Serialized Arrays with meta_query
- explode array within shortcode
- Display post_object content using Advanced Custom Fields plugin
- Remove old custom field after import
- Unable to get Preview of Uploaded image within a Custom Meta box
- Retrieve custom fields on Categories, using WP-API
- Order by custom field date?
- Change content before writing to database
- Order Custom post type loop by custom field (datepicker)
- Using Custom Function With Advanced Custom Fields
- automatically set “Featured Image” the same as the og:i that is set in a custom field
- Custom field for default gallery
- Execute/Parse Shortcode in Native WordPress Custom Field Value Field
- Displaying Custom Fields on Post with Genesis Child Theme
- Unable to show ACF’s Image Custom Field properly in Genesis Framework [closed]
- Add source URL from Feed WordPress (Syndication) plugin to a custom field in post editor
- How can I pass a variable set by ACF to header.php?
- WP Custom Fields Metabox Disappears – ACF plugin issue [closed]
- Transfer self made functions.php custom fields to Advanced Custom Fields [closed]
- Create WordPress shortcode with php code inside
- How to schedule a custom field value update?
- Add new image block, set default class name and update it using Javascript
- Get an advanced custom field after post publish
- Using advanced custom fields from one custom post type in another custom post type / using nested shortcodes
- How to render a custom post type template with custom fields using shortcode
- How to create a shortcode to print specific values stored in a post meta array?
- WooCommerce – Adding Custom Fields To Invoice
- Declaring in variables [closed]
- Custom wysiwyg editor doesn’t execute shortcodes?
- Populate Javascript code with value from WordPress Custom Field?
- Custom Field 101
- Shortcode To Display Post Custom Field Value in Post Title, Post Content
- How to list Category list in ACF Pro’s Select Field to choose from [closed]
- custom field (video/audio url) and embed functionality
- Get all the posts where meta field with multiple choice has several values checked
- Custom fields issue [closed]
- Querying posts by latitude and longitude to build a Google Maps with several markers
- Display MP3 as media using an URL from a custom field
- Using a custom field inside a shortocde
- ACF: How to get users with a ACF flexible content subfield with a specific value AND layout?
- Function that replaces the image in the absence of the post meta
- ul list with only as many li’s as filled custom fields
- Display custom field from the front page on another page
- Enable a short code in the custom meta field
- Including Custom fields within the_content
- Let Users Filter Posts by Custom Fields
- Filter posts by custom field (Advanced Custom Fields)
- How can I output the custom fields wrapping with HTML
- Plugin or shortcode for ISBN number?
- Displaying an ACF list of users
- The conditional logic only works to show or hide?
- ACF Plugin How to make the customer add more fields in the post?
- How to use shortcode inside of shortcode in theme
- How to get custom image field of specific post id
- Replacing custom field with shortcode
- How To Save Data From Remote APIs To ACF?
- comments_where Hook
- Problem with revisions only returning four results
- How to set up page fields with gutenberg instead of ACF
- ACF multi taxonomy on filterable gallery
- Is there any way to make a custom field for a post only if the author is a certain user?
- How to use ACF with javascript to update custom field values?
- how can i show WordPress custom field data to my short code?
- adding autosave feature to custom fields
- Search fails when using the radio buttons
- Getting user’s data, by custom field lookup (meta)
- Create Shortcode shows only posts with custom_field meta
- PHP and Shortcode Combination
- ACF – Compare user and post data
- Counting number of images from loop
- How to add content with a filter when there’s no content in the editor
- Advanced Custom Fields from Category – IF statement
- Stop truncation of shortcodes in custom text fields?
- Retrieving Advanced Custom Field within Shortcode Function [closed]
- Query Posts based on custom field value
- Display Child Page with custom fields within Parent Page
- WordPress taxonomy child image
- Add custom field to post with some part of url as value
- Filter and display a specific custom field value [closed]
- Custom field in a shortcode?
- Display meta data from a custom field within plugin Category Grid View Gallery
- Insert wp gallery shortcode into custom textarea
- Displaying shortcode content inside custom field without images
- Parse Shortcodes in Theme’s Custom Field?
- Insert shortcode before and after a list automatically
- Update field name without losing the value
- Adding custom field to an array
- Custom fields doesnt work well with any postTAB plugin
- How to include custom field in shortcode (do_shortcode) in theme file
- Truncating characters in Advanced Custom Fields works some places but not others?
- Conditional display based on ACF checkbox
- How to add an ACF only for parent term?
- Best way for managing images of ads banners
- ACF in radio button cf7