I am trying to embed some audio into a Content Template. The link works when copy/pasting the URL into the HTML but does not work when populating from the custom field, which contains the exact same data. Obviously I need it to come from the custom field so it is dynamic from post to post. Can you help troubleshoot?
The problem here is that the [embed] wordpress shortcode doesn't allow the nesting of shortcodes. It requires that you provide the actual URL.
What kind of custom field are you using? Is it an Audio field or an Embedded media field. If its an audio type custom field then it should render the link in an embedded media player.
The field is a URL. Is there a way to make it work this way or do I need to either convert it to a media field (not sure how to do that) or use a different shortcode? My preference is to keep the field stored as a URL because I may change the coding and/or player used to display the content, so keeping it as a URL allows me some flexibility in that regard.
Its the fact that wordpress doesn't allow for the nesting of their shortcodes. This means that you're not able to use a shortcode inside the [embed] shortcode.
The only solution I can think of is to create a wrapper shortcode for the embed shortcode which will process our Types shortcode before passing it to the embed shortcode.
However just passing it to the [embed] shortcode won't work given the changes in wordpress some years ago. Are you familiar with how to create custom shortcodes?
Does a media field store the actual file or does it render a embedded player from a URL? If the latter, is there an easy way to convert the field from a URL to a media field? Then I wouldn't need to use the [embed] shortcode? Most of the URL's are to YouTube, Vimeo, or an audio or video file stored at Amazon Web Services.
Regarding writing custom shortcodes, this sounds like the best solution but is not my area of expertise and I would have a hard time knowing where to start . I've done it before but usually with input from somebody else.
The embedded media field would work for this because you are able to post your URL into the field. This will then render your field using the embedded player for wordpress.
If you use our embedded media field then you wont need to worry about using the wordpress embed shortcode.
Okay I switched the field type to embedded media and it works. I also did the same for my video and that also worked. The only problem is embedding content from Odysee, which I'm guessing you don't support. I will put in a feature request for that. Thanks.