Created
July 2, 2021 17:19
-
-
Save stefenphelps/bbd58c7c5b7c570a9e3f460e64318390 to your computer and use it in GitHub Desktop.
Get ACF oEmbed URL via Timber
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# the simple way to get the URL from an oEmbed field #} | |
{% if item.meta('oembed') %} | |
<div class="category-featured-post"> | |
{% set videoSrc = item.meta('oembed')|split("src=") %} | |
{% set videoUrl = videoSrc[1]|split('"') %} | |
{{ videoUrl[1] }} | |
</div> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment