Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

PHP code issue while showing posts from a certain category


  #1  
Old Mar 29, 2011, 02:43 AM
sradhey
 
9 posts · Aug 2010
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 ?

Last edited by juggledad; Mar 29, 2011 at 04:39 AM. Reason: spelling
  #2  
Old Mar 29, 2011, 04:45 AM
juggledad's Avatar
juggledad
 
23,628 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Mar 29, 2011 at 04:53 AM.
  #3  
Old Apr 1, 2011, 03:35 PM
sradhey
 
9 posts · Aug 2010
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.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sidebar Issue-Recent Posts and Meta showing up in Sidebar,Should Only be Links sdchoboken Atahualpa 3 Wordpress theme 1 Jul 13, 2010 06:27 PM
[SOLVED] Images showing html code wrapped around photo in Posts (pages are fine) - Pa gungo Atahualpa 3 Wordpress theme 7 Jan 4, 2010 03:20 AM
[SOLVED] Images showing html code wrapped around photo in Posts (pages are fine) gungo Atahualpa 3 Wordpress theme 2 Jan 2, 2010 06:43 AM
issue: blank Central Panel - PHP code options stored with an \ ssokolenko New Versions, & Updating 3 Sep 15, 2009 05:29 PM
Posts showing up twice on category pages? michiganbasketball Atahualpa 3 Wordpress theme 1 Mar 12, 2009 04:56 PM


All times are GMT -6. The time now is 12:12 PM.


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