前提・実現したいこと
Wordpressで自社HPを制作しています。ヘッダーエリアにyoutube動画を挿入できるテンプレートを使っているのですが、モバイル時は代替画像が表示される設定になっており、これをモバイルでもyoutube動画が音声ありで再生できるように設定できるようにしたいです。
発生している問題・エラーメッセージ
・ else : // if is mobile device 以下の構文をどうすればいいのかわかりません。
nonce_failure
該当のソースコード
PHP
1elseif ( $header_content_type === 'type3' ) : // Youtubeの動画を背景に表示する 2 if ( ! wp_is_mobile() ) : // if is pc 3 $youtube_url = $options['youtube_url']; 4 if ( ! empty( $youtube_url ) ) : 5?> 6 <div id="header-youtube" class="header-youtube"> 7 <div class="header-youtube-overlay"></div> 8 </div> 9 <div id="youtube-video-player" class="player" data-property="{videoURL:'<?php echo esc_url( $youtube_url ); ?>',containment:'#header-youtube',startAt:0,mute:false,autoPlay:true,loop:true,opacity:1}"></div> 10<?php 11 endif; 12 else : // if is mobile device 13 $youtube_image = wp_get_attachment_image_src( $options['youtube_image'], 'full' ); 14?> 15 <div class="header-youtube" style="background-image: url(<?php echo $youtube_image[0]; ?>);"> 16 </div> 17<?php 18 endif; 19
試したこと
・else : // if is mobile device 以下を削除
・各種プラグイン実装
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。