I have the following code in a Wordpress page template:
<?php $args = array( 'post_type' => 'casestudies', 'posts_per_page' => 12 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
echo '<div class="casestudy">'.'<a href="<?php the_permalink() ?>" class="anchor- hover">'.get_the_post_thumbnail( $post->ID, '180,180' ).'</div>'.'</a>';
echo '<span class="details">'.'<div class="anchor-hover details-h3">'.the_title().'</div>';
echo '<p class="desc">'.get_post($post_id)->post_excerpt.'</p>'.'</span>';
endwhile; ?>
<div class="clear"></div>
I need to wrap the entire display starting with "echo" with this div:
<div<?php post_class('margin') ?> id="post-<?php the_ID(); ?>">
The title and excerpt are only supposed to show when the cursor is hovering over the thumbnail, but I can't get this line of code in without an unexpected syntax error.
I am able to get this to work on the archive for this post type so there should be some way to do it.