I am a long time listener first time caller.
I am working on a wordpress theme and I am having trouble with one of the loops on my category page. I have 2 loops on the category page, the first loop which Im having trouble with, is suppose to show the most recent post from whatever category the user is viewing while the 2 loop displays a grid of the rest of the posts. Both loops work except the first one is not pulling the title or featured images for the post. Here is the code-
<?php global $post; $cat_posts = get_posts('numberposts=1&category='.$catID);
foreach($cat_posts as $post) : ?>
<div class="featuredimagec"> <?php global $post; if(has_post_thumbnail()) {
the_post_thumbnail(); }?>
<p> <a href="<?php the_permalink() ?>"><?php the_post_thumbnail('large'); ?></a></p> </div><div class="featuredcontenttex">
<?php $postTitle = get_the_title(); if($title != $postTitle) :?>
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?>
</a></h1><?php the_excerpt(); ?>
</div>
</div>
<?php endif ;?>
<?php endforeach; ?>
<?php wp_reset_query(); ?>
Any help would be appreciated. Thanks.
Change:
To: