PHP code issue while showing posts from a certain category
I am using Content ABOVE the LOOP area to show some posts from certain categories.
I am using the following code to show 5 posts from category 3: <?php query_posts('cat=3&showposts=5'); ?> <ul> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> <?php endwhile;?> </ul> It works perfectly but then the same output is shown IN THE LOOP as well. I want IN THE LOOP to display all the rest of the categories (everything except category with id 3). How do I do this ? |
The way you have this coded, it will show on ALL pages
what are you trying to accomplish? also, do not double post the same question, it WILL delay a response |
Thanks for the reply.
I am trying to show posts from certain categories in different sections of the homepage. Example at: http://www.thewealthwisher.com/testTWW/ I want to show Personal Finance News (category) on the homepage - I am adding code in Content Above the loop for this. I want the rest of the categories except Personal Finance News to come at the section "From the blog" which I guess is The LOOP itself. This is achievable via plugins but I was wondering whether PHP code can be used. |
All times are GMT -6. The time now is 11:31 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.