• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

2 Ways To Get & Display YouTube Thumbnail Images by Video I.D

This tutorial provides both the code and the code installed in the Genesis Sample child theme.

The code provides 2 ways to display YouTube video images in Genesis and will work in any theme with some basic modification.

Included are:

1. A page template which displays a grid of YouTube thumbnails like this:

youtube-thumbnail

2. And the Genesis Sample theme also includes code which enables you to hook in the images anywhere in your theme. In this example, its after single posts:

after-post

Once you install the code or the theme, you simply need to:

  1. Grab the YouTube video I.D from each YouTube video URL.
  2. Click Add Custom Field on each Edit post screen
  3. Enter youtube as the Name and the ID as the value like you see in the following image:

youtube-custom-field

Save the post after adding the custom field and you’re done.

1. The Page Template Code

Using a code editor, create a new file named page_youtube.php and add the following PHP code to the file which you can then upload to your child themes root directory.

Register for full access

Related Code Snippets

  • Genesis Video Template

Video

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.