You forgot the closing </audio>
tag at the end.
function html5_audio($atts, $content = null) {
extract(shortcode_atts(array(
"src" => '',
"preload"=> 'none',
"loop" => ''
), $atts));
return '<audio src="'.$src.'" preload="'.$preload.'" loop="'.$loop.'" /></audio>';
}
add_shortcode('audio', 'html5_audio');
Related Posts:
- How to add ‘class’ attribute into shortcode [audio]?
- Audio or playlist shortcode condition according to the amount of files on attachment page
- Using audio shortcode for .mp3 URLs with a query string
- Changing playlist shortcode thumbnail sizes?
- Legacy Audio Shortcode
- Extending the Audio Shortcode
- Are .MP3 files with capital letter extensions allowed in [audio] shortcode?
- Reloading a Mediaelement audio player
- How can I implement shortcode on click event
- Displaying audio player as preview in audio post in WP3.6
- How to add data attributes to the wordpress audio shortcode
- Is the WP audio shortcode still relevant?
- Add audio file to post using custom term meta field as link [closed]
- WordPress core playlist function not showing artist and album info
- Conditionally Loading JavaScript/CSS for Shortcodes
- Show shortcode without executing it
- How to create a shortcode with 1 parameter (atts)
- How does a shortcode work?
- Run visual composer code in php page
- Remove wptexturize from a shortcode?
- Using shortcode in Post title
- Does a shortcode with a single attribute have to use an array?
- WP_enqueue_script inside shortcode?
- template_redirect to accompany with a shortcode
- Tinymce shortcodes within shortcode contents
- Post loop created via shortcode not displaying shortcode in content
- Pass shortcode variables to template
- passing multiple parents value into a shortcode
- Is it possible to add a repeater field to TinyMCE’s option window?
- How do I preview the result of a shortcode in the TinyMCE editor?
- esc_attr not working in shortcode
- Raw output (preventing wpautop)
- Conditionally loading Facebook PHP SDK in shortcode
- How to handle shortcodes when using the JSON API
- Are shortcode functions applied while rendering the content, or are they executed and stored with the post content?
- is_admin() returns false in save_post hook with Gutenberg editor
- Why are Shortcodes Disabled in Widgets by Default?
- Get Posts shortcode plugin and meta_query?
- possibility to control embedded video timeline with buttons and links external to the player
- Add custom setting that uses radio button to WP Gallery
- Shortcode with hyphen doesn’t work
- WordPress Gallery shortcode: Display one category ID only
- How to get gallery id inserted to a post?
- WordPress Shortcode show database row
- Custom shortcode is not working in text widget
- Shortcodes won’t work on live environment
- add action only if gallery shortcode attribute is equal to?
- Shortcode for order number [closed]
- Edit shortcode in post content programatically
- How to change to local video player on shortcode ultimate to video.js?
- Adding shortcode field to edit gallery / Gallery Settings
- return unformatted content in encosing shortcode
- Hide Selection of Text From Archive, but Show on Single Posts
- How to display Feedburner subscription count as plain text via a shortcode in post/page editor of my WordPress blog?
- Function result goes outside div
- Shortcode in my childtheme is not working
- Displaying shortcode in footer
- Displaying shortcode output through Options Framework
- How to Generate html tags using shortcodes?
- Adding custom form within add_shortcode
- Show form per shortcode
- Use another action instead of the shortcode API to display the last time a user logged in
- how to add shortcode in wordpress container [duplicate]
- Get array of shortcodes within string
- Shortcode arguments to another shortcode
- Adding a custom field to do_shortcode [closed]
- contact form 7 database short codes [closed]
- how to create a fav icon shortcode?
- Video shortcode, option are not rendered
- Color on Shortcode insert that creates a button
- shortcode doesnt work on excerpt
- Adding Author URL to Nav Menu via Shortcode
- Displaying an interactive web map on my wordpress site
- Date Shortcode in Image alt and title tags
- access shortcode atts in template part
- Pagination for custom posts loop
- Modify [caption] shortcode so and are not used?
- May an attribute have no value?
- SQL query to bulk change short code in all posts
- Display shortcode in text field with wordpress settings api
- How to strip header tags & shortcodes from the_excerpt()
- shortcode display metainformation as linked image
- Reusable Dynamic Taxonomy Shortcode
- How to display a page dependent on a url parameter supplied by a form/button page?
- WordPress plugin shortcodes not outputting anything
- WordPress Gallery with ID’s Shortcode not Working
- Featured image with link to post shortcode, image displaying above the post
- Where is escaped the shortcode?
- How to stop unwanted splits in excerpts when using shortcodes for sliders or players
- shortcode change variable base on user
- Inserting shortcode is blanking excerpt – any ideas?
- Escaping a shortcode so it displays as-is [duplicate]
- If do_shortcode is blank, return some message
- Previous/Next with the same category
- I’ve broken the short code for Contact Form 7!
- echo a shortcode in a shortcode code?
- Applying if (get_post_meta) to new shortcode
- Nested ShortCode works inside the_content, but not outside of it
- Why does my shortcode query not working with search term
- How to use multiple values in “Shortcode”? [closed]