Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1302408
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 4 years ago.
Improve this questionI am using the plugin ‘WP Maintenance Mode’ to load a under maintenance website on a website.
I would like for audio to play as soon as somebody lands on the website and for audio player to remain invisible.
<p style="text-align: center;">BACK SOON</p>
[audio src="https://myWebsite/wp-content/uploads/2021/03/audio.mp3"]
This will load the page and show the audio player and it will play when I press play
I have tried
[audio src="https://myWebsite/wp-content/uploads/2021/03/audio.mp3 width = "0" height = "0" autoplay=1]
to try and get it to play automatically and without the audio player, but no success.
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 4 years ago.
Improve this questionI am using the plugin ‘WP Maintenance Mode’ to load a under maintenance website on a website.
I would like for audio to play as soon as somebody lands on the website and for audio player to remain invisible.
<p style="text-align: center;">BACK SOON</p>
[audio src="https://myWebsite/wp-content/uploads/2021/03/audio.mp3"]
This will load the page and show the audio player and it will play when I press play
I have tried
[audio src="https://myWebsite/wp-content/uploads/2021/03/audio.mp3 width = "0" height = "0" autoplay=1]
to try and get it to play automatically and without the audio player, but no success.
Share Improve this question edited Mar 2, 2021 at 21:44 fuxia♦ 107k38 gold badges255 silver badges459 bronze badges asked Mar 2, 2021 at 15:33 user202731user202731 1 3- The documentation says it's autoplay="on" – Rup Commented Mar 2, 2021 at 15:43
- Can you get this to work on a normal page? Is it just the maintenance mode page where this doesn't work? – Rup Commented Mar 2, 2021 at 15:44
- 1 Browsers are very particular about things that autoplay, especially things with sound. You may find that what you want isn't possible on some major browsers. As for the WP Maintenance plugin, I don't see that it's related to this question other than circumstance, people might think this is a problem specific to that plugin and vote to close the question – Tom J Nowell ♦ Commented Mar 2, 2021 at 16:02
1 Answer
Reset to default 1A 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 ofon
:
Broken tag:
[audio src="https://myWebsite/wp-content/uploads/2021/03/audio.mp3 width = "0" height = "0" autoplay=1]
Fixed
[audio src="https://myWebsite/wp-content/uploads/2021/03/audio.mp3" width="0" height="0" autoplay="on"]
- Second, I'm not 100% sure that WP Maintenance posts can process shortcodes. I would instead use a standard HTML Audio Tag.
本文标签: Auto play audio using WP Maintenance Mode Plugin
版权声明:本文标题:Auto play audio using WP Maintenance Mode Plugin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741711783a2393885.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论