sheep_o5
フォーラムへの返信
4件の返信を表示中 - 1 - 4件目 (全4件中)
-
フォーラム: 使い方全般
返信が含まれるトピック: 特定のカテゴリーの新着記事のみを取得フォーラム: 使い方全般
返信が含まれるトピック: 固定ページ内での条件分岐ループを消して、試してみたのですが見出し画像が表示されませんでした。
他に原因があるということでしょうか。
content-page.php内の下記ソースに<?php wp_reset_query(); ?>を記述しないと
page-スラッグ.phpの投稿内容が吐き出してくれない状態です。。<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <h1 class="entry-title"> <?php if(is_page('contact')): ?> <img src="<?php bloginfo('template_url'); ?>/images/contact.jpg" width="780px" height="50px" alt="top" /> <?php elseif(is_page('recruit')): ?> <img src="<?php bloginfo('template_url'); ?>/images/recruit.jpg" width="780px" height="50px" alt="top" /> <?php elseif(is_page('system')): ?> <img src="<?php bloginfo('template_url'); ?>/images/system.jpg" width="780px" height="50px" alt="top" /> <?php endif; ?> </h1> </header><!-- .entry-header --> <?php wp_reset_query(); ?> <div class="entry-content">
フォーラム: 使い方全般
返信が含まれるトピック: 固定ページ内での条件分岐ありがとうございます。
ループ内で使用してないので問題ないはずなのですが、page.phpから
content-page.phpを呼び出すときに、ルーフで呼び出している影響でしょうか。<?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', 'page' ); ?> <?php // If comments are open or we have at least one comment, load up the comment template if ( comments_open() || '0' != get_comments_number() ) : comments_template(); endif; ?> <?php endwhile; // end of the loop. ?>
フォーラム: 使い方全般
返信が含まれるトピック: 固定ページ内での条件分岐content-page.php内で、条件分岐でpage-スラッグ.php別に、見出し画像を変更したいのですが、反映されません。
ご教授お願い出来ますでしょうか。
<h1 class="entry-title"> <?php if(is_page('recruit')): ?> <img src="<?php bloginfo('template_url'); ?>/images/recruit.jpg" width="780" height="50" alt="" /> <?php elseif(is_page('hotel')): ?> <img src="<?php bloginfo('template_url'); ?>/images/hotel.jpg" width="780" height="50" alt="" /> <?php elseif(is_page('system')): ?> <img src="<?php bloginfo('template_url'); ?>/images/system.jpg" width="780" height="50" alt="" /> <?php endif; ?> </h1>
4件の返信を表示中 - 1 - 4件目 (全4件中)