how to switch out music file for another using php echo
you can’t change file name. If you want to change file name dynamically try using acf for that. https://www.advancedcustomfields.com/resources/page-link/
you can’t change file name. If you want to change file name dynamically try using acf for that. https://www.advancedcustomfields.com/resources/page-link/
Need help with wordpress audio preload
The code requires at least PHP 5.3. Dreamweaver does not support that PHP version, so it reports unknown, newer syntax as errors. WordPress requires just version 5.2.4, but it recommends at least 5.4. My suggestion is to use always the latest stable version on the server, currently PHP 5.6. Your development setup should use exactly … Read more
If the plugin has shortcodes, then you can use the function do_shortcode to display it within a theme file. It’d be a case of: <div class=”align-center”><?php do_shortcode( “[audio-player title=”Lorem Ipsum”]” ); ?></div>
You should be putting in the URL rather than a system path as the flash will requesting files via http. Say your site is on http://localhost/wordpress/ … Your URLs need to look like http://localhost/wordpress/wp-content/themes/maVersion/audio/dance.mp3
First and most important step. Check and make sure your hosting account has the available space. Login to your hosting control panel and check how much disk space you have used. Next verify your PHP settings are actually what you have tried to set them to (this will tell you the limits set in PHP): … Read more
A couple of things: First, this code has some syntax issues – the src attribute isn’t properly closed. Further, as noted by @Rup, autoplay should have a value of on: Broken tag: Fixed Second, I’m not 100% sure that WP Maintenance posts can process shortcodes. I would instead use a standard HTML Audio Tag.
<script> $(‘audio,video’).mediaelementplayer({features: [‘playpause’,’progress’,’current’,’duration’,’tracks’,’volume’,’fullscreen’]}); </script>
The simplest solution would be to put the audio player after the read-more link. If that would prove cumbersome (e.g. you’ve already got too may posts with audio players), you could try hooking into the the_content filter, and remove the audio player if not on a single-post view. e.g.: function mytheme_remove_audio_player_from_home( $content ) { // … Read more
<?php if (strstr($audio, ‘<iframe’)) { echo $audio; } else { echo wp_oembed_get( get_post_meta($post->ID, ‘_format_audio_embed’, true) ); } ?> Of course, this would require that you get the custom field with the audio embed code or url into $audio 🙂 Edit – try: <?php $audio = get_post_meta($post->ID, ‘_format_audio_embed’, true); if (strstr($audio, ‘<iframe’)) { echo $audio; } … Read more