Code to show a video (using custom fields) on custom post
-
Hi,
We’re using Custom Fields to create a custom-styled post. Very simple, just a few images, description and…. one video. This is the part causing me problems.
The custom field type used for uploading videos is the wysiwyg editor. Field is called “pet_video”. This behind the scenes all works just fine.
However, the video is not showing up on the post. I realise I need some code to go into the custom posts php (called “single_pet.php”), but everything I have tried results in nothing good!
The images show perfectly using this simple bit of code:
<div class="single_pet_image"> <?php $attachment_id = get_field('pet_image_3'); $size = "medium"; // (thumbnail, medium, large, full or custom size)?> <?php echo wp_get_attachment_image( $attachment_id, $size );?> </div>
How can I get the video to show as well?
Thank you for any help.
- The topic ‘Code to show a video (using custom fields) on custom post’ is closed to new replies.