Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   PHP code issue while showing posts from a certain category (http://forum.bytesforall.com/showthread.php?t=13543)

sradhey Mar 29, 2011 02:43 AM

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 ?

juggledad Mar 29, 2011 04:45 AM

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

sradhey Apr 1, 2011 03:35 PM

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 03:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.