The wordpress theme I am currently using is currently set up to only display the most recent posts from one particular category on the blog's homepage. You will see below, by default it is category 1. I would like to be able to have the front page display posts from all categories, or at least be able to add additional category numbers. Ideally I would like it to display the last 6 posts from any category instead of 5 posts from category 1 as shown in the code below.
Quick PHP Question
4
The wordpress theme I am currently using is currently set up to only display the most recent posts from one particular category on the blog's homepage. You will see below, by default it is category 1. I would like to be able to have the front page display posts from all categories, or at least be able to add additional category numbers.
Ideally I would like it to display the last 6 posts from any category instead of 5 posts from category 1 as shown in the code below.
Any ideas how I can accomplish this?
Ideally I would like it to display the last 6 posts from any category instead of 5 posts from category 1 as shown in the code below.
Any ideas how I can accomplish this?
Code:
<!--Replace cat=1 with the Category ID you want to display in this section.-->
<?php $recent = new WP_Query("cat=1&showposts=5"); while($recent->have_posts()) : $recent->the_post();?>
<?php if( get_post_meta($post->ID, "thumbnail", true) ): ?>
<a href="<?php the_permalink() ?>" rel="bookmark">
<img style="float:left;margin:0px 10px 0px 0px;" src="<?php echo get_post_meta($post->ID, "thumbnail", true); ?>" alt="<?php the_title(); ?>" /></a> - The Pension Guy
- [ 1 ] Thanks
- [1] reply
- blase40
- rtrotter
- [ 1 ] Thanks
Next Topics on Trending Feed
-
4