Title: Page Tempates with custom fields
Last modified: April 26, 2020

---

# Page Tempates with custom fields

 *  [userperson](https://wordpress.org/support/users/userperson/)
 * (@userperson)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/page-tempates-with-custom-fields/)
 * Hi, I am trying to create a page template for my site that displays a different
   youtube video at the top of every page. I need the template to have parameters
   that could be filled through its own [little widget on the side of my editor](https://i.imgur.com/BtG6JDv.png)
   or just another page attribute?
 * My template looks something like this:
 *     ```
       <?php
       /*
       Template Name: Video 
       Template Post Type: post
       */
   
       get_header(); ?>
   
       <iframe src="https://www.youtube.com/embed/[YOUTUBE_ID]" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" width="100%" height="450" frameborder="0"></iframe>
   
       <?php
       get_sidebar();
       get_footer();
       ```
   
 * Instead of hard coding a single youtube vid, the “`[YOUTUBE_ID]`” part could 
   be replaced with whatever video id I put in that field. Is this possible?
    -  This topic was modified 6 years, 3 months ago by [userperson](https://wordpress.org/support/users/userperson/).

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 3 months ago](https://wordpress.org/support/topic/page-tempates-with-custom-fields/#post-12734421)
 * I’d use the plugin Advanced Custom Fields to put that metabox on the side of 
   the page or add it as a custom field above or below the edit page’s content area.
 *  Thread Starter [userperson](https://wordpress.org/support/users/userperson/)
 * (@userperson)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/page-tempates-with-custom-fields/#post-12734479)
 * With the Advanced Custom Fields plugin, how am I supposed to link those fields
   to my page template? Assuming you mean [this plugin](https://wordpress.org/plugins/advanced-custom-fields/).
   
   I am confused…
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [6 years, 3 months ago](https://wordpress.org/support/topic/page-tempates-with-custom-fields/#post-12734497)
 * Yes, that plugin. Read their documentation.
 * [https://www.advancedcustomfields.com/resources/displaying-custom-field-values-in-your-theme/](https://www.advancedcustomfields.com/resources/displaying-custom-field-values-in-your-theme/)
   
   [https://www.advancedcustomfields.com/resources/adding-fields-posts/](https://www.advancedcustomfields.com/resources/adding-fields-posts/)
 *  Thread Starter [userperson](https://wordpress.org/support/users/userperson/)
 * (@userperson)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/page-tempates-with-custom-fields/#post-12734589)
 * Thank you so much! I understand now.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Page Tempates with custom fields’ is closed to new replies.

## Tags

 * [parameters](https://wordpress.org/support/topic-tag/parameters/)
 * [templates](https://wordpress.org/support/topic-tag/templates/)
 * [Themes](https://wordpress.org/support/topic-tag/themes/)
 * [variables](https://wordpress.org/support/topic-tag/variables/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 4 replies
 * 2 participants
 * Last reply from: [userperson](https://wordpress.org/support/users/userperson/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/page-tempates-with-custom-fields/#post-12734589)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
