WordPress/固定ページに投稿記事&ページ内リンク
固定ページに、特定のカテゴリーの投稿記事を掲載する。(抜粋ではなく、全ての内容)
そのページのサイドに、ページ内リンクを貼る。(クリックするとその場所にジャンプ)
<?php /* Template Name: ★★★ */ ?> <?php get_header(); ?> <!-- ▼メインBOX▼ --> <DIV id="main"> <?php /*▼新着順にする*/ ?> <?php query_posts($query_string .'&orderby=modified'); ?> <?php /*▼カテゴリーを指定する*/ ?> <?php $posts = get_posts("numberposts=-1 &cat=★"); foreach ($posts as $post): setup_postdata($post); ?> <a id="<?php the_title() ?>" name="<?php the_title() ?>"></a> <h2><a href="<?php the_permalink() ?>"><?php the_title() ?></a></h2> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail(); ?></a> <?php the_content(); ?> <?php endforeach; ?> </DIV> <!-- ▲メインBOX▲ --> <!-- ▼サイドBOX▼ --> <DIV id="side"> <ul> <?php $posts = get_posts("numberposts=-1 &cat=★"); foreach ($posts as $post): setup_postdata($post); ?> <li><a href="#<?php the_title() ?>"><?php the_title() ?></a></li> <?php endforeach; ?> </ul> </DIV> <!-- ▲サイドBOX▲ --> <?php get_footer(); ?>