テーマのデフォルトの構成にはない要望があって
wordpressのheaderに追加のhtml要素を書き込みました結果、index.php
で追加の要素を表示出来ましたが、他のpage.php, page-lp.php等
では表示されません。
header.phpは名前を変更しないなら
<?php get_header(); ?>
で呼び出すことが出来るはずです。index.phpでは呼び出されていて追加要素が
反映されています。
同じ呼び出し方であるのに、page.php, page-lp.php では追加要素が反映しないのでしょうか?
初心者でwordpressの使い方が良く分かっていないためググりながら
対応していますが、どうしてもわからないので質問いたします。
よろしくお願いします。
wordpress バージョン: WordPress 5.2.4 (stork テーマ)
header.php の変更点
php
1<h1 class="h1 text"><a href="<?php echo esc_url(home_url()); ?>" rel="nofollow"><?php bloginfo('name'); ?></a></h1>
php
1<h1 class="h1 text"><a href="<?php echo esc_url(home_url()); ?>" rel="nofollow"><?php bloginfo('name'); ?> 2// 追加点 3<div class="text1">すこやかフィットネス</div> 4<h1 class="h1 text">Let's play with the body</h1></a></h1>
index.php側の呼び出し
php
1<?php get_header(); ?> 2<div id="content"> 3<div id="inner-content" class="wrap cf"> 4<main id="main" class="m-all t-all d-5of7 cf" role="main"> 5<div class="archivettl"> 6<?php if (is_category()) { ?> 7<h1 class="archive-title h2"> 8//以下略
page.php, page-lp.php の呼び出し
<?php get_header(); ?> <div id="content"> <div id="inner-content" class="wrap cf"> <main id="main" class="m-all t-all d-5of7 cf" role="main"> <?php get_template_part( 'parts_add_top' ); ?>
回答2件
あなたの回答
tips
プレビュー