Last active
August 29, 2015 14:01
-
-
Save hitsujixgit/67e3e8e302a3678148e9 to your computer and use it in GitHub Desktop.
固定ページの本文を挿入するコード
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(have_posts()) { | |
echo '<h2 class="post-title">'.$title.'</h2>'; | |
// 固定ページ "category-information-acquisition" の本文を挿入する | |
$cat_discription_page = get_page_by_path('category-information-acquisition'); | |
if(isset($cat_discription_page)) { | |
echo '<div class="post-content">'.apply_filters('the_content', $cat_discription_page->post_content).'</div><hr />'; | |
} | |
while(have_posts()) { | |
the_post(); | |
get_template_part('content','excerpt'); | |
} | |
get_template_part('pagination','pages'); | |
} else { | |
echo '<p>該当する記事がありません</p>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment