Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   Limit number of posts when only showing one category (http://forum.bytesforall.com/showthread.php?t=3783)

bodger Oct 8, 2009 09:17 AM

Limit number of posts when only showing one category
 
I'm using some code in my central column which checks to make sure that a post is in a particular category ("Top Story") before actually showing it on the home page.

What I want to do is to only display, say, 3 of the top stories and no more.

The trouble is, if I limit the number of visible posts using the standard Wordpress Reading settings to 3, then it only actually shows me 1 post - because the posts that are in that category are something like the 1st, 5th and 9th post in the list of posts.

So is there a way I can somehow set the posts limit to "quite high" and then tell the central column code in Atahualpa to only show the top story posts until its shown 3 of them?

What do you think?

juggledad Oct 8, 2009 10:32 AM

Look at Example 2 at ATO->Style & edit CENTER COLUMN and instead of checkinng for the front page check the category

bodger Oct 8, 2009 10:38 AM

Yeah, I tried that in the first place but the bf_ata['post_count'] variable increases with literally every post in the whole database of posts - not just the ones that are in the category I'm after.

So if the posts that are in the category I'm interested in are post numbers 1, 5 and 9 and I use:-

<?php if ( in_category('top-story') AND $bfa_ata['postcount'] == 3 ) { ?>

then I only see the first one.

Obviously I could increase the number from 3 to, say, 25 to make sure I get all of the top stories but then, if there are 18 posts in that category out of the last 25 posts, I'll have 18 posts on the page!

juggledad Oct 8, 2009 11:27 AM

there is a writeup in the gold forum about how to make the front page a static page, but display an item from a cateory (anouncements) that could probably be tweeked to do what you want.


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

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