How to display WordPress custom fields with conditional statements

Sometimes you need to display post-specific content using WordPress custom fields. In this example we will show you how you can display custom field data using conditional statements in the form of a youtube video embed. If the post has a “youtube-video-id” defined, the content will be rendered.

Instructions
Insert content as shown below.

Snippet Info

Tested with Wordpress v. NA

How to display WordPress custom fields with conditional statements
4.8 (95.81%) 43 votes
Please report broken snippets.
Report Broken Snippet