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

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems