質問編集履歴
2
sydneyダウンロードページを追記しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
|
7
7
|
音声が伴って再生されません。。
|
8
8
|
|
9
|
+
sydneyダウンロードサイト→https://athemes.com/theme/sydney/
|
10
|
+
|
9
11
|
|
10
12
|
|
11
13
|
フロントページのヘッダーを動画にした場合、音声も一緒に再生されるようにするにはどうしたら良いのでしょうか。
|
1
該当箇所と思われるphpコードを抜粋致しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -21,3 +21,199 @@
|
|
21
21
|
ミュートにしているなどのコードが見当たりませんでした。
|
22
22
|
|
23
23
|
Chromeからのコード検証でもミュートにしているなどの記述は確認できませんでした。
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
header.php該当箇所?
|
28
|
+
|
29
|
+
```ここに言語を入力
|
30
|
+
|
31
|
+
<div class="sydney-hero-area">
|
32
|
+
|
33
|
+
<?php sydney_slider_template(); ?>
|
34
|
+
|
35
|
+
<div class="header-image">
|
36
|
+
|
37
|
+
<?php sydney_header_overlay(); ?>
|
38
|
+
|
39
|
+
<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'); ?>">
|
40
|
+
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<?php sydney_header_video(); ?>
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
<?php do_action('sydney_inside_hero'); ?>
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
```
|
52
|
+
|
53
|
+
video-widget.php
|
54
|
+
|
55
|
+
```ここに言語を入力
|
56
|
+
|
57
|
+
<?php
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
class Sydney_Video_Widget extends WP_Widget {
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
public function __construct() {
|
66
|
+
|
67
|
+
$widget_ops = array('classname' => 'sydney_video_widget_widget', 'description' => __( 'Display a video from Youtube, Vimeo etc.', 'sydney') );
|
68
|
+
|
69
|
+
parent::__construct(false, $name = __('Sydney: Video', 'sydney'), $widget_ops);
|
70
|
+
|
71
|
+
$this->alt_option_name = 'sydney_video_widget';
|
72
|
+
|
73
|
+
}
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
function form($instance) {
|
78
|
+
|
79
|
+
$title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
|
80
|
+
|
81
|
+
$url = isset( $instance['url'] ) ? esc_url( $instance['url'] ) : '';
|
82
|
+
|
83
|
+
$video_mode = isset( $instance['video_mode'] ) ? esc_attr( $instance['video_mode'] ) : '';
|
84
|
+
|
85
|
+
$text = isset( $instance['text'] ) ? wp_kses_post( $instance['text'] ) : '';
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
?>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
<p>
|
94
|
+
|
95
|
+
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'sydney'); ?></label>
|
96
|
+
|
97
|
+
<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; ?>" />
|
98
|
+
|
99
|
+
</p>
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
<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>
|
104
|
+
|
105
|
+
<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>
|
106
|
+
|
107
|
+
<p><label for="<?php echo $this->get_field_id('video_mode'); ?>"><?php _e('Video mode:', 'sydney'); ?></label>
|
108
|
+
|
109
|
+
<select name="<?php echo $this->get_field_name('video_mode'); ?>" id="<?php echo $this->get_field_id('video_mode'); ?>">
|
110
|
+
|
111
|
+
<option value="vid-normal" <?php if ( 'vid-normal' == $video_mode ) echo 'selected="selected"'; ?>><?php echo __('Normal', 'sydney'); ?></option>
|
112
|
+
|
113
|
+
<option value="vid-lightbox" <?php if ( 'vid-lightbox' == $video_mode ) echo 'selected="selected"'; ?>><?php echo __('Lightbox', 'sydney'); ?></option>
|
114
|
+
|
115
|
+
</select>
|
116
|
+
|
117
|
+
</p>
|
118
|
+
|
119
|
+
<p><label for="<?php echo $this->get_field_id( 'text' ); ?>"><?php _e( 'Text before the play button (only for lightbox mode):', 'sydney' ); ?></label>
|
120
|
+
|
121
|
+
<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>
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<?php
|
126
|
+
|
127
|
+
}
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
function update($new_instance, $old_instance) {
|
132
|
+
|
133
|
+
$instance = $old_instance;
|
134
|
+
|
135
|
+
$instance['title'] = strip_tags($new_instance['title']);
|
136
|
+
|
137
|
+
$instance['url'] = esc_url_raw($new_instance['url']);
|
138
|
+
|
139
|
+
$instance['video_mode'] = sanitize_text_field($new_instance['video_mode']);
|
140
|
+
|
141
|
+
if ( current_user_can( 'unfiltered_html' ) ) {
|
142
|
+
|
143
|
+
$instance['text'] = $new_instance['text'];
|
144
|
+
|
145
|
+
} else {
|
146
|
+
|
147
|
+
$instance['text'] = wp_kses_post( $new_instance['text'] );
|
148
|
+
|
149
|
+
}
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
return $instance;
|
154
|
+
|
155
|
+
}
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
function widget($args, $instance) {
|
160
|
+
|
161
|
+
if ( ! isset( $args['widget_id'] ) ) {
|
162
|
+
|
163
|
+
$args['widget_id'] = $this->id;
|
164
|
+
|
165
|
+
}
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
extract($args);
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
$title = ( ! empty( $instance['title'] ) ) ? $instance['title'] : '';
|
174
|
+
|
175
|
+
$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
|
176
|
+
|
177
|
+
$url = isset( $instance['url'] ) ? esc_url( $instance['url'] ) : '';
|
178
|
+
|
179
|
+
$video_mode = isset( $instance['video_mode'] ) ? esc_html($instance['video_mode']) : 'vid-normal';
|
180
|
+
|
181
|
+
$text = isset( $instance['text'] ) ? $instance['text'] : '';
|
182
|
+
|
183
|
+
echo $before_widget;
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
if ( $title ) echo $before_title . $title . $after_title;
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
if( ($url) ) {
|
192
|
+
|
193
|
+
echo '<div class="sydney-video ' . $video_mode . '">';
|
194
|
+
|
195
|
+
echo '<div class="video-overlay">';
|
196
|
+
|
197
|
+
echo '<div class="sydney-video-inner"><span class="close-popup"><i class="fa fa-times"></i></span>' . wp_oembed_get($url) . '</div>';
|
198
|
+
|
199
|
+
echo '</div>';
|
200
|
+
|
201
|
+
echo '<div class="video-text">' . $text . '</div>';
|
202
|
+
|
203
|
+
echo '<a href="#" class="toggle-popup"><i class="fa fa-play"></i></a>';
|
204
|
+
|
205
|
+
echo '</div>';
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
echo $after_widget;
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
}
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
}
|
218
|
+
|
219
|
+
```
|