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

質問編集履歴

3

コードの追加

2019/05/23 08:38

投稿

dogfood
dogfood

スコア19

title CHANGED
File without changes
body CHANGED
@@ -67,4 +67,119 @@
67
67
  </div>
68
68
  </div>
69
69
  </div>
70
+ ```
71
+
72
+
73
+ CSSで編集することにしましたが、やはりうまく表示されません。
74
+ wordpressに打ち込んでいるHTML
75
+ ```
76
+ <div class="price-top site-blocks-cover inner-page" data-aos="fade" data-stellar-background-ratio="0.5">
77
+ <div class="row align-items-center justify-content-center">
78
+ <div class="col-md-7 text-center" data-aos="fade">
79
+ <h1>ご利用料金</h1>
80
+ <span class="caption d-block text-white">price menu</span>
81
+
82
+ </div>
83
+ </div>
84
+ </div>
85
+ ```
86
+
87
+ header.phpのhtml
88
+ ```
89
+ <!DOCTYPE html>
90
+ <html lang="ja">
91
+ <head>
92
+ <title><?php bloginfo('name'); ?> 麻布十番パーソナルジム 業界最安完全貸切ジム - 【ボディメイキングボックス】 <?php wp_title(); ?></title>
93
+ <meta charset="utf-8">
94
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
95
+
96
+ <link href="<?php bloginfo( 'stylesheet_directory' ); ?>/https://fonts.googleapis.com/css?family=Amatic+SC:400,700|Work+Sans:300,400,700" rel="stylesheet">
97
+ <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_directory' ); ?>/fonts/icomoon/style.css">
98
+
99
+ <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_directory' ); ?>/css/bootstrap.min.css">
100
+ <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_directory' ); ?>/css/magnific-popup.css">
101
+ <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_directory' ); ?>/css/jquery-ui.css">
102
+ <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_directory' ); ?>/css/owl.carousel.min.css">
103
+ <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_directory' ); ?>/css/owl.theme.default.min.css">
104
+ <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_directory' ); ?>/css/bootstrap-datepicker.css">
105
+ <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_directory' ); ?>/css/animate.css">
106
+
107
+ <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_directory' ); ?>/https://cdn.jsdelivr.net/npm/mediaelement@4.2.7/build/mediaelementplayer.min.css">
108
+
109
+
110
+
111
+ <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_directory' ); ?>/fonts/flaticon/font/flaticon.css">
112
+
113
+ <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_directory' ); ?>/css/aos.css">
114
+ <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_directory' ); ?>/css/myedit.css">
115
+
116
+
117
+ <link href="<?php bloginfo('stylesheet_url'); ?>" rel="stylesheet">
118
+
119
+
120
+ <?php wp_head(); ?>
121
+ </head>
122
+ <body style="background-image: url('<?php bloginfo( 'stylesheet_directory' ); ?>/images/bg.jpg');">
123
+
124
+ <div class="site-wrap">
125
+
126
+
127
+
128
+ <div class="site-mobile-menu">
129
+ <div class="site-mobile-menu-header">
130
+ <div class="site-mobile-menu-close mt-3">
131
+ <span class="icon-close2 js-menu-toggle"></span>
132
+ </div>
133
+ </div>
134
+ <div class="site-mobile-menu-body"></div>
135
+ </div> <!-- .site-mobile-menu -->
136
+
137
+
138
+ <div class="site-navbar-wrap js-site-navbar bg-white">
139
+
140
+ <div class="container">
141
+ <div class="site-navbar bg-light">
142
+ <div class="py-1">
143
+ <div class="row align-items-center">
144
+ <div class="col-2">
145
+ <h2 class="mb-0 site-logo"><a href="<?php bloginfo('url'); ?>/">BodyMaking<strong>Box</strong></a></h2>
146
+ </div>
147
+ <div class="col-10">
148
+ <nav class="site-navigation text-right" role="navigation">
149
+ <div class="container">
150
+ <div class="d-inline-block d-lg-none ml-md-0 mr-auto py-3"><a href="#" class="site-menu-toggle js-menu-toggle text-black"><span class="icon-menu h3"></span></a></div>
151
+
152
+ <ul class="site-menu js-clone-nav d-none d-lg-block">
153
+ <li class="has-children">
154
+ <a href="<?php bloginfo('url'); ?>/program">プログラム</a>
155
+ <ul class="dropdown arrow-top">
156
+ <li><a href="<?php bloginfo('url'); ?>/program#beginner/">初心者メニュー</a></li>
157
+ <li><a href="<?php bloginfo('url'); ?>/program#diet/">ダイエットメニュー</a></li>
158
+ <li><a href="<?php bloginfo('url'); ?>/program#powerup/">筋力アップメニュー</a></li>
159
+ </ul>
160
+ </li>
161
+ <?php wp_nav_menu( array(
162
+ 'theme_location'=>'place_global',
163
+ 'container' =>'',
164
+ 'menu_class' =>'',
165
+ 'items_wrap' => '%3$s',//<ul>を出力しない
166
+ ));
167
+ ?>
168
+ </ul>
169
+ </div>
170
+ </nav>
171
+ </div>
172
+ </div>
173
+ </div>
174
+ </div>
175
+ </div>
176
+ </div>
177
+
178
+ ```
179
+
180
+ 背景を読み込ませた、CSSファイル
181
+ ```CSS
182
+ .price-top{
183
+ background-image: url(/wp-content/themes/bodymakingbox/images/pricetop.jpeg);
184
+ }
70
185
  ```

2

追加の情報

2019/05/23 08:38

投稿

dogfood
dogfood

スコア19

title CHANGED
File without changes
body CHANGED
@@ -38,4 +38,33 @@
38
38
  images/pricetop.jpeg
39
39
 
40
40
 
41
- [images] フォルダはwp-contentのthemeに入れた自作テーマのフォルダに入っております。
41
+ [images] フォルダはwp-contentのthemeに入れた自作テーマのフォルダに入っております。
42
+
43
+
44
+ 改めて下記のように打ち込んでおりますが、やはり表示ができません。
45
+ functions.php
46
+ ```php
47
+ function imagepassshort($arg) {
48
+ $content = str_replace('"images/', '"' . get_bloginfo('template_directory') . '/images/', $arg);
49
+ return $content;
50
+ }
51
+ add_action('the_content', 'imagepassshort');
52
+
53
+ function imagepassshortTemp($arg) {
54
+ return get_bloginfo('template_directory') . '/images/' . $arg;
55
+ }
56
+
57
+ ```
58
+
59
+ ワードプレス固定ページのHTML
60
+ ```HTML
61
+ <div class="site-blocks-cover inner-page" style="background-image: url(<?php echo imagepassshortTemp('pricetop.jpeg'); ?>);" data-aos="fade" data-stellar-background-ratio="0.5">
62
+ <div class="row align-items-center justify-content-center">
63
+ <div class="col-md-7 text-center" data-aos="fade">
64
+ <h1>ご利用料金</h1>
65
+ <span class="caption d-block text-white">price menu</span>
66
+
67
+ </div>
68
+ </div>
69
+ </div>
70
+ ```

1

URLの追加

2019/05/23 07:25

投稿

dogfood
dogfood

スコア19

title CHANGED
File without changes
body CHANGED
@@ -28,4 +28,14 @@
28
28
  }
29
29
  add_action('the_content', 'imagepassshort');
30
30
 
31
- ```
31
+ ```
32
+
33
+
34
+ 固定ページのURLは、
35
+ wordpress/price/
36
+
37
+ 画像のURLは
38
+ images/pricetop.jpeg
39
+
40
+
41
+ [images] フォルダはwp-contentのthemeに入れた自作テーマのフォルダに入っております。