[Resuelto] Audio Embed Not Working for Dynamic Content
Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.
Problem:
The problem here is that the user wanted to pass our Types shortcode into the wordpress default embed shortcode.
Solution:
Unfortunately the [embed][/embed] shortcode by wordpress doesn't support the use of shortcodes to provide data for the field.
In this case We recommend that you use our Embedded Media custom fields to store items that you want to display on your page.
This support ticket is created hace 3 años, 1 mes. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
Sun
Mon
Tue
Wed
Thu
Fri
Sat
-
9:00 – 12:00
9:00 – 12:00
9:00 – 12:00
9:00 – 12:00
9:00 – 12:00
-
-
13:00 – 18:00
13:00 – 18:00
13:00 – 18:00
14:00 – 18:00
13:00 – 18:00
-
Supporter timezone: America/Jamaica (GMT-05:00)
Este tema contiene 6 respuestas, tiene 2 mensajes.
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.