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

質問編集履歴

1

phpでテーマを追記しました

2021/06/03 07:34

投稿

satomisan
satomisan

スコア5

title CHANGED
File without changes
body CHANGED
@@ -5,4 +5,58 @@
5
5
  display:noneも探してみましたが、見つからずでした。
6
6
 
7
7
  わかる方がいれば教えて下さい。
8
- [https://demo.tcd-theme.com/tcd063/](https://demo.tcd-theme.com/tcd063/)
8
+ [https://demo.tcd-theme.com/tcd063/](https://demo.tcd-theme.com/tcd063/)
9
+
10
+ ```php
11
+ <?php $dp_options = get_design_plus_options(); ?>
12
+
13
+ <?php if ( 'type1' === $dp_options['header_content_type'] ) : // Image ?>
14
+ <div id="js-header-slider" class="p-header-slider" data-speed="<?php echo esc_attr( $dp_options['header_slider_animation_time'] * 1000 ); ?>">
15
+
16
+ <?php
17
+ for ( $i = 1; $i <= 5; $i++ ) :
18
+ if ( ! $dp_options['header_slider_img' . $i] ) continue;
19
+ ?>
20
+ <div class="p-header-slider__item p-header-slider__item--<?php echo esc_attr( $i ); ?> p-header-content">
21
+ <div class="p-header-content__inner">
22
+ <div class="p-header-content__title<?php if ( 'type1' === $dp_options['header_slider_catch_writing_mode' . $i] ) { echo ' p-header-content__title--vertical'; } ?>">
23
+ <span><?php echo nl2br( esc_html( $dp_options['header_slider_catch' . $i] ) ); ?></span>
24
+ </div>
25
+ </div>
26
+ <div class="p-header-slider__item-img p-header-slider__item-img--<?php echo esc_attr( $dp_options['header_slider_img_animation_type' . $i] ); ?>" data-animation="<?php if ( 'type3' !== $dp_options['header_slider_img_animation_type' . $i] ) { echo '1'; } ?>"></div>
27
+ </div>
28
+ <?php endfor; ?>
29
+
30
+ </div>
31
+
32
+ <?php elseif ( 'type2' === $dp_options['header_content_type'] ) : // Video ?>
33
+ <div id="js-header-video" class="p-header-video p-header-content is-active">
34
+
35
+ <?php if ( ! wp_is_mobile() ) : ?>
36
+ <video autoplay loop muted>
37
+ <source src="<?php echo esc_attr( wp_get_attachment_url( $dp_options['header_video'] ) ); ?>">
38
+ </video>
39
+ <?php endif; ?>
40
+
41
+ <div class="p-header-content__inner">
42
+ <div class="p-header-content__title<?php if ( 'type1' === $dp_options['header_video_catch_writing_mode'] ) { echo ' p-header-content__title--vertical'; } ?>">
43
+ <span><?php echo nl2br( esc_html( $dp_options['header_video_catch'] ) ); ?></span>
44
+ </div>
45
+ </div>
46
+ </div>
47
+
48
+ <?php elseif ( 'type3' === $dp_options['header_content_type'] ) : // YouTube ?>
49
+ <div id="js-header-youtube" class="p-header-youtube p-header-content is-active">
50
+
51
+ <?php if ( ! wp_is_mobile() ) : ?>
52
+ <div id="js-header-youtube__player" class="p-header-youtube__player" data-video-id="<?php echo esc_attr( $dp_options['header_youtube_id'] ); ?>"></div>
53
+ <?php endif; ?>
54
+
55
+ <div class="p-header-content__inner">
56
+ <div class="p-header-content__title<?php if ( 'type1' === $dp_options['header_youtube_catch_writing_mode'] ) { echo ' p-header-content__title--vertical'; } ?>">
57
+ <span><?php echo nl2br( esc_html( $dp_options['header_youtube_catch'] ) ); ?></span>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ <?php endif; ?>
62
+ ```