I don’t know why you are using a custom template for displaying an individual Video post when there is a single file that is used for this purpose – single-{post_type}
.
https://codex.wordpress.org/Post_Type_Templates
Using the single file, you will be able to get the post ID with $post->ID
or get_the_ID()
.
if( have_posts() ) : while( have_posts() ) : the_post();
echo get_post_meta( $post->ID, 'video_url', true );
// you can display all post's information within this loop
endwhile; endif;
You can find more about the WordPress Template Hierarchy here.
Related Posts:
- what is the correct way to compare dates in a WP query_posts meta_query
- Advanced search form with filters for custom taxonomies and custom fields
- Custom field values deleted when trashing custom post type
- How to get all custom fields of any post type
- Admin Area Custom Type Search By Meta Fields Without Title & Content
- How do I Paginate Search Results for Custom Post Types?
- How Can I save multiple records in same meta key?
- Detect meta value changes when post is updated (post_updated)
- Search everything (posts, pages, tags, cpt, meta)
- How to get source of custom meta image?
- Displaying Meta Box Image
- ACF Upload Image in repeater from front-end with custom form? – add_post_meta()
- Formatting custom meta box date from YYYY/MM/DD to a more readable alternative
- Create a random unique 6 digit number as custom field for custom post type
- how to interconnect custom post types?
- List all images from a single post meta value
- Populate Custom Fields in a Custom Post Type?
- Meta Key Value in current-user-only loop
- How to check if user meta field is empty in conditional else statement
- How to implement a Google map store locator
- Posting to a Custom Post Type from front end – user generated content
- Update Post Meta for a logged in user
- A better way to add a meta box to custom post types
- Two Custom Post Types Many to Many Relationship
- get_post_meta not working on publishing
- How do I set all of a particular post meta to a value within the custom post type I’m in?
- Custom fields (wp_post_meta) vs Custom Table for large amount of data
- Importing Data from a Non-WordPress database, into WP
- Custom fields for custom post type
- Check if post with same meta value exists
- Submitting Custom Post Types with custom fields from Front-end form
- create custom meta box with default value
- delete_post_meta() for whole CPT / multiple posts?
- How to get specific post meta by title or id
- copy images from custom field to another custom field
- How to show custom field on specific custom post type posts only when filled
- How can I output WPAlchemy repeating fields meta values in my page template?
- How to call a post’s metadata in shortcode.php?
- delete duplicate meta_value with same post_id
- Search CPT Title AND Meta
- updating one custom meta field only
- Add a class to post_class if more than one post shares same meta_value_num
- Add a meta field to the list of results for a custom post type
- Empty meta-box returns publishdate if no value is set?
- Filter search posts by post meta?
- Custom fields for post or terms which don’t update on post update
- Custom Post Type meta data getting deleted on bulk editing taxonomies
- Unable to gather Image URL from Custom Post Type’s; Custom Meta Field
- How to keep custom post type related information
- How can I add a meta[] to my custom post type and search by term with the Rest API?
- Show posts from WP Custom Post Type selected from a field in a metabox
- Creating an archive page or simple template to list all values of a custom field of specific post type listing
- Where is get_post_meta value located?
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- How to Disable option of meta field if that option is selected for any other post in custom post type?
- Add more custom fields when creating a new custom post type
- How do I extract the contents of a CPT’s custom field for all posts?
- Delete custom post type metadata without deleting the post in admin area
- How can I get the $key / $value pairs of custom fields that were added via 3rd party plugins or themes?
- How to add post reference field to a plugin?
- Advanced search form with filters for custom taxonomies and custom fields
- Querying meta values within an array
- Display a list of posts whose meta field values are equal to the ID of the post being viewed?
- Check for custom field value in different post type than current one and do something
- don’t publish custom post type post if a meta data field isn’t valid
- How to filter custom posts by tags and custom fields?
- How to order adjacent posts (prev / next) by custom field value?
- How can I generate a RSS feed based on a custom WP_Query?
- ACF Relationships in Custom Post Type Permalink
- Search Custom Post Type with all meta attached?
- Automatically assign a custom post to a custom taxonomy based on custom field value
- Display two post types ordered by two custom fields
- Sort by two dates. Default entry date and custom field if present
- Insert post metadata for all posts in CPT at once if metadata no existent
- Add field to all custom post types
- Dynamic dropdown select values depending on other custom field value
- Admin Custom Meta Box – Pull Last 5 Posts from Custom Post Type
- List Taxonomies: Don’t list taxonomy if it has no post – depending on custom post-meta?
- How to let users choose where to search for posts?
- WP_Query orderby not work with meta_key
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- Returning a custom content types with meta values
- Reusable metabox backend and frontend
- How to display wp_post by custom field value?
- Cannot Save MetaBox Data in Custom Post Type
- Display custom post front end filter by ACF equals current user
- Can’t save meta box data in WordPress using custom post types
- How to avoid duplicate posts queried from custom meta?
- How do I query with multiple custom fields orderby in same column?
- Custom Fields through plugin in a Custom Post Type
- Need some suggestion/help with custom post types project
- How to enable the user to add value through the admin panel?
- Two plugins sharing the same custom post type registration
- Displaying database table in backend of wordpress
- Show a custom field instead of username in the backend author area
- Custom meta box includes
- How to display Author Profile based on Custom field value
- Function to Compare CPT Post Custom Value with Default Posts CF Value
- Display code if title of the custom post matches title of other post
- Sort CPT by taxonomy AND THEN by custom field