Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

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


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #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
 
19,975 posts · Mar 2009
OSX 10.6.8/10.7.3 WP 2.8.x/2.9.x/3.x Atahualpa 3.5.x/3.7.x Safari 5.x Firefox 11 XP
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

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 08:39 PM.


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