質問するログイン新規登録

質問編集履歴

2

sydneyダウンロードページを追記しました

2017/08/18 04:18

投稿

yuya-nakamoto
yuya-nakamoto

スコア7

title CHANGED
File without changes
body CHANGED
@@ -2,6 +2,7 @@
2
2
  WordPressテーマ『Sydney』でウェブサイトを作成しています。
3
3
  ヘッダーメディアの部分でmp4動画を再生するように設定していますが
4
4
  音声が伴って再生されません。。
5
+ sydneyダウンロードサイト→https://athemes.com/theme/sydney/
5
6
 
6
7
  フロントページのヘッダーを動画にした場合、音声も一緒に再生されるようにするにはどうしたら良いのでしょうか。
7
8
  ご教授のほどよろしくお願い致します。

1

該当箇所と思われるphpコードを抜粋致しました

2017/08/18 04:18

投稿

yuya-nakamoto
yuya-nakamoto

スコア7

title CHANGED
File without changes
body CHANGED
@@ -9,4 +9,102 @@
9
9
  ###試したこと
10
10
  テーマの編集でphpのコードを探しましたが音声を
11
11
  ミュートにしているなどのコードが見当たりませんでした。
12
- Chromeからのコード検証でもミュートにしているなどの記述は確認できませんでした。
12
+ Chromeからのコード検証でもミュートにしているなどの記述は確認できませんでした。
13
+
14
+ header.php該当箇所?
15
+ ```ここに言語を入力
16
+ <div class="sydney-hero-area">
17
+ <?php sydney_slider_template(); ?>
18
+ <div class="header-image">
19
+ <?php sydney_header_overlay(); ?>
20
+ <img class="header-inner" src="<?php header_image(); ?>" width="<?php echo esc_attr( get_custom_header()->width ); ?>" alt="<?php bloginfo('name'); ?>" title="<?php bloginfo('name'); ?>">
21
+ </div>
22
+ <?php sydney_header_video(); ?>
23
+
24
+ <?php do_action('sydney_inside_hero'); ?>
25
+ </div>
26
+ ```
27
+ video-widget.php
28
+ ```ここに言語を入力
29
+ <?php
30
+
31
+ class Sydney_Video_Widget extends WP_Widget {
32
+
33
+ public function __construct() {
34
+ $widget_ops = array('classname' => 'sydney_video_widget_widget', 'description' => __( 'Display a video from Youtube, Vimeo etc.', 'sydney') );
35
+ parent::__construct(false, $name = __('Sydney: Video', 'sydney'), $widget_ops);
36
+ $this->alt_option_name = 'sydney_video_widget';
37
+ }
38
+
39
+ function form($instance) {
40
+ $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
41
+ $url = isset( $instance['url'] ) ? esc_url( $instance['url'] ) : '';
42
+ $video_mode = isset( $instance['video_mode'] ) ? esc_attr( $instance['video_mode'] ) : '';
43
+ $text = isset( $instance['text'] ) ? wp_kses_post( $instance['text'] ) : '';
44
+
45
+ ?>
46
+
47
+ <p>
48
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'sydney'); ?></label>
49
+ <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />
50
+ </p>
51
+
52
+ <p><label for="<?php echo $this->get_field_id( 'url' ); ?>"><?php _e( 'Paste the URL of the video (only from a network that supports oEmbed, like Youtube, Vimeo etc.):', 'sydney' ); ?></label>
53
+ <input class="widefat" id="<?php echo $this->get_field_id( 'url' ); ?>" name="<?php echo $this->get_field_name( 'url' ); ?>" type="text" value="<?php echo $url; ?>" size="3" /></p>
54
+ <p><label for="<?php echo $this->get_field_id('video_mode'); ?>"><?php _e('Video mode:', 'sydney'); ?></label>
55
+ <select name="<?php echo $this->get_field_name('video_mode'); ?>" id="<?php echo $this->get_field_id('video_mode'); ?>">
56
+ <option value="vid-normal" <?php if ( 'vid-normal' == $video_mode ) echo 'selected="selected"'; ?>><?php echo __('Normal', 'sydney'); ?></option>
57
+ <option value="vid-lightbox" <?php if ( 'vid-lightbox' == $video_mode ) echo 'selected="selected"'; ?>><?php echo __('Lightbox', 'sydney'); ?></option>
58
+ </select>
59
+ </p>
60
+ <p><label for="<?php echo $this->get_field_id( 'text' ); ?>"><?php _e( 'Text before the play button (only for lightbox mode):', 'sydney' ); ?></label>
61
+ <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('text'); ?>" name="<?php echo $this->get_field_name('text'); ?>"><?php echo $text; ?></textarea></p>
62
+
63
+ <?php
64
+ }
65
+
66
+ function update($new_instance, $old_instance) {
67
+ $instance = $old_instance;
68
+ $instance['title'] = strip_tags($new_instance['title']);
69
+ $instance['url'] = esc_url_raw($new_instance['url']);
70
+ $instance['video_mode'] = sanitize_text_field($new_instance['video_mode']);
71
+ if ( current_user_can( 'unfiltered_html' ) ) {
72
+ $instance['text'] = $new_instance['text'];
73
+ } else {
74
+ $instance['text'] = wp_kses_post( $new_instance['text'] );
75
+ }
76
+
77
+ return $instance;
78
+ }
79
+
80
+ function widget($args, $instance) {
81
+ if ( ! isset( $args['widget_id'] ) ) {
82
+ $args['widget_id'] = $this->id;
83
+ }
84
+
85
+ extract($args);
86
+
87
+ $title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : '';
88
+ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
89
+ $url = isset( $instance['url'] ) ? esc_url( $instance['url'] ) : '';
90
+ $video_mode = isset( $instance['video_mode'] ) ? esc_html($instance['video_mode']) : 'vid-normal';
91
+ $text = isset( $instance['text'] ) ? $instance['text'] : '';
92
+ echo $before_widget;
93
+
94
+ if ( $title ) echo $before_title . $title . $after_title;
95
+
96
+ if( ($url) ) {
97
+ echo '<div class="sydney-video ' . $video_mode . '">';
98
+ echo '<div class="video-overlay">';
99
+ echo '<div class="sydney-video-inner"><span class="close-popup"><i class="fa fa-times"></i></span>' . wp_oembed_get($url) . '</div>';
100
+ echo '</div>';
101
+ echo '<div class="video-text">' . $text . '</div>';
102
+ echo '<a href="#" class="toggle-popup"><i class="fa fa-play"></i></a>';
103
+ echo '</div>';
104
+ }
105
+ echo $after_widget;
106
+
107
+ }
108
+
109
+ }
110
+ ```