Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme »

Limit number of posts when only showing one category


  #1  
Old Oct 8, 2009, 09:17 AM
bodger
 
4 posts · Sep 2009
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?
  #2  
Old Oct 8, 2009, 10:32 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Look at Example 2 at ATO->Style & edit CENTER COLUMN and instead of checkinng for the front page check the category
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Oct 8, 2009, 10:38 AM
bodger
 
4 posts · Sep 2009
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!
  #4  
Old Oct 8, 2009, 11:27 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing Excerpts or Full Post Depending Upon Number of Posts LindaS Excerpts, Read more, Pagination 0 Sep 8, 2009 06:27 AM
Limit the number of posts per page mcgiver058 Atahualpa 3 Wordpress theme 1 Aug 20, 2009 09:01 PM
Limit the number of Posts on Home Page coaxkid Post-Kicker, -Byline & -Footer 4 Apr 12, 2009 06:01 PM
Private posts not showing up on category bar wing23 Atahualpa 3 Wordpress theme 0 Mar 27, 2009 07:57 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 05:10 AM.


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