How to import embedded audios to posts?
Feedzy RSS Feeds offers the possibility of importing embedded audio to posts so that you can easily introduce music, podcasts, or any audio file to your posts.
π Note: If you need more details about importing feed as posts, check this doc.
- 1
- In the import wizard, open the Map Content tab.
- 2
- Go to the Content field and add this line:
<audio controls><source src="[#item_custom_enclosure@url]" type="audio/mpeg"></audio>
The tag used here is just an example; it can be different according to your feed. In this case, we are utilizing this feed: https://feed.podbean.com/greenupwealth/feed.xml, and the tag we found is [#item_custom_enclosure@url] because, in the XML Feed element, this is where the value is placed for every item.
πNote: Due to the custom tag parsing, the Developer or Agency plans of Feedzy are required. Here is a doc that explains the tags in detail.
- 3
- Save and start importing the files and see how it works.
π Additional information
There is a slight chance that it didn't work. Check if the added HTML elements disappear from the content field ( this can be checked if you click to edit the import, open the map content and check if the provided code is still there ), you need to make some additional steps:
- 1
- Open the functions.php of your child theme and add this code:
function custom_wpkses_post_tags( $tags, $context ) { if ( 'post' === $context ) { $tags['iframe'] = array( 'src' => true, 'height' => true, 'width' => true, 'frameborder' => true, 'allowfullscreen' => true, ); $tags['source'] = array( 'src' => true, 'height' => true, 'width' => true, 'frameborder' => true, 'type' => true, ); } return $tags; } add_filter( 'wp_kses_allowed_html', 'custom_wpkses_post_tags', 10, 2 );
This should make the code not disappear again from the content field.
- 2
- To make sure that the HTML characters can be imported, add this constant to the wp-config.php file of your theme:
define( 'FEEDZY_ALLOW_UNSAFE_HTML', true );
π‘ Result