I created a custom post type of boxes with logos & text running four to a row. I created a working post archive for this, but now I need to bring these into another page that has additional text and images before and after where the custom post type needs to display. What’s the correct way to do this?
My basic page template:
<?php
/*
Template Name: Work
*/
get_header(); ?>
<div id="body">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php wp_link_pages(array('before' => 'Pages: ', 'next_or_number' => 'number')); ?>
<?php endwhile; endif; ?>
</div>
<?php get_footer(); ?>
Here is the archive php which I’m trying to get to display in the page template:
<?php
get_header();
?>
<div class="post">
<?php if (have_posts()) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) {
?>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<?php } ?>
<div id="body"><h2>Case Studies</h2></div>
<?php while (have_posts()) : the_post(); ?>
<div<?php post_class('margin') ?> id="post-<?php the_ID(); ?>">
<div class="casestudy"><a href="<?php the_permalink() ?>" class="anchor-hover">
<?php echo get_the_post_thumbnail( $post->ID, '180,180' ); ?>
<span class="details">
<div class="anchor-hover details-h3"><?php the_title(); ?></div>
<p class="desc"><?php echo get_post($post_id)->post_excerpt; ?></p>
</span>
</a>
</div>
<?php endwhile; endif; ?>
<div class="clear"></div>
</div>
</div>
<?php get_footer(); ?>
Is this what you are lookin for?