Displaying different category posts side by side.
-
Hello,
I’m trying to modify a theme slightly so that instead of displaying a ‘featured’ article, it will display two featured articles side by side from different categories. I took my original piece of code, copied it and changed them slightly hoping it would work but so far nothing. The first article and second article display the same thumbnail and title, however both do display their correct excerpt. Any pointers would be great.
<div id="frontpageWidget1"> <h3> Latest News </h3> <?php $postslist = get_posts('numberposts=1&category=3&order=DESC&orderby=date'); foreach ($postslist as $post) : setup_postdata($post); ?> <?php the_post_thumbnail('thumbnail') ?><BR /> <a href="<?php the_permalink() ?>"><?php the_title(); ?></a> <?php the_excerpt(); ?> <?php endforeach; ?> </div> <div id="frontpageWidget2"> <h3> Latest Explorer News </h3> <?php $postslist2 = get_posts('numberposts=1&category=4&order=DESC&orderby=date'); foreach ($postslist2 as $post2) : setup_postdata($post2); ?> <?php the_post_thumbnail('thumbnail') ?><BR /> <a href="<?php the_permalink() ?>"><?php the_title(); ?></a> <?php the_excerpt(); ?> <?php endforeach; ?> </div>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Displaying different category posts side by side.’ is closed to new replies.