Skip to content

Instantly share code, notes, and snippets.

@hitsujixgit
Last active August 29, 2015 14:01
Show Gist options
  • Save hitsujixgit/67e3e8e302a3678148e9 to your computer and use it in GitHub Desktop.
Save hitsujixgit/67e3e8e302a3678148e9 to your computer and use it in GitHub Desktop.
固定ページの本文を挿入するコード
<?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