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 » Post-Kicker, -Byline & -Footer »

[SOLVED] Display only one category in front page posts


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 Dec 19, 2009, 09:16 AM
majofa
 
13 posts · Jul 2009
[SOLVED] Display only one category in front page posts

I am trying to display posts of only one category in the front page.

I tried
<?php if (is_front_page()) query_posts('cat=8'); ?>
that I thought was the logic solution, but did not work.

Suggestions ?
  #2  
Old Dec 22, 2009, 04:05 AM
juggledad's Avatar
juggledad
 
20,151 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
I'll assume that you are putting using this at ATO->Style & edit CENTER COLUMN->The LOOP
you should try this. Insert as the first line
HTML Code:
<?php if ((is_front_page() and is_category('8')) or (!is_front_page()) { ?>
and add to the last line in The LOOP
HTML Code:
<?php } ?>
As the LOOP is processed, this will say is this the front page, and is this a cat 8? if so process the loop, otherwise if this is NOT the front page, proceed.
  #3  
Old Dec 22, 2009, 06:47 PM
majofa
 
13 posts · Jul 2009
Juggledad, I tried as you instructed, but I ended up with no posts displayed at all.

I tried several other categories like "Category 10" or "Category 3" and the results were the same.
  #4  
Old Dec 23, 2009, 05:23 AM
juggledad's Avatar
juggledad
 
20,151 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
Two things,
1) do posts show up on other pages?
2) what is the maximum number of posts that will show up on a page?

the answer to (1) will tell me if the logic works.

What I think is happeniong is that you have said 'display X posts ona page' and there are no category '8' posts in the first X posts. The loop is running saying 'Give me the next X posts, THEN this code runs and checks to see if the post is in CAT 8, if not it discards it and goes oin to the next.

So say you will display 10 posts per page and none of the first 10 ae in cat 8, nothing will display, if 2 are in cat 8, then 2 should display, if 4, then 4 will display, etc etc.
  #5  
Old Dec 23, 2009, 02:14 PM
majofa
 
13 posts · Jul 2009
1) No posts show up on other pages.

2) The maximum number of posts is set to 4. Category 8 has 141 posts.

We are still in the process of building this site.
You can see the problem at http://ligadeascenso.com/2009/
And you can see how it should look at http://ix.ligadeascenso.com displaying posts of all categories.

Last edited by majofa; Dec 23, 2009 at 05:21 PM.
  #6  
Old Dec 24, 2009, 05:26 AM
juggledad's Avatar
juggledad
 
20,151 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
oops, the IS_CATEGORY should be IN_Category so this is the first line
HTML Code:
<?php if ((is_front_page() and in_category('8')) or (!is_front_page()) { ?>

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[How To] modify 'Category Page' aka page2cat to display posts instead of just titles juggledad Plugins & Atahualpa 37 Jun 25, 2010 09:03 AM
Making separate pages to display posts by category; also, how to embed WP page Eric Bobrow Atahualpa 3 Wordpress theme 1 Dec 2, 2009 12:34 AM
Display posts alphabetically for one category, chronologically for other categories spencer Atahualpa 3 Wordpress theme 2 Nov 18, 2009 04:21 AM
how to horizontally display the Category Posts Widget ? bryan85 Plugins & Atahualpa 0 Sep 6, 2009 06:28 PM
[SOLVED] Need static header image to display on the front page but no image on any o joaodagraca Header configuration & styling 2 Aug 10, 2009 01:45 AM


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


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