Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经做了很多搜索,我正在拔出我头发上剩下的东西。PHP代码本身是:
<?php echo wp_get_attachment_url($file->ID) ?>
...简码是:[embed][/embed]
[embed][/embed]
我尝试了各种“做简码”的变体,但无法让事情正常进行。你能建议正确的代码吗?
WordPress(3.6 或更高版本)有一个audio简码,以下应该可以工作:
audio
$mp3 = wp_get_attachment_url( $file->ID ); echo do_shortcode( '[audio src="' . $mp3 . '"]' );
更多信息:https ://codex.wordpress.org/Audio_Shortcode