WordPressのコンテンツを静的ページ内に設置する

2010年 8月 4日 (水) / PM 4:35

   <ul id="blog">
    <?php
        require('../blog/wp-blog-header.php');
        switch_to_blog(2); // サイトIDを指定

        $posts = get_posts();
        foreach ($posts as $post):
        setup_postdata($post);
    ?>
    <li><div class="blog_title"> [ <?php the_time('Y.m.d') ?> ] <a href="<?php the_permalink() ?>"><?php the_title() ?></a></div><?php the_content(); ?></li>
    <?php endforeach; ?>
    <li></li>
   </ul>

コメントを残す