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 »

Limiting the home page to one (most recent) post


  #1  
Old Jul 28, 2009, 01:40 PM
cbmrj777's Avatar
cbmrj777
 
5 posts · Jul 2009
Help Limiting the home page to one (most recent) post

URL: http://hoguesandkisses.com/

I want to display only one post on the home page and all other pages (archives, etc.) display 5 posts (or whatever amount I want - just more than 1).

I made a home.php using the index.php file and added this code that I found in the Wordpress.org forums like this:

Code:
<!-- Limit the home page to display only one (the latest) post -->
	<?php query_posts('showposts=1'); ?>
above this:
Code:
<?php /* If there are any posts: */
if (have_posts()) : $bfa_ata['postcount'] == 0; /* Postcount needed for option "XX first posts full posts, rest excerpts" */ ?>
And under Wordpress admin Reading Settings I have it set "Blog pages show at most" 5 posts.

It does exactly what I want: display 1 post on the home page BUT

when I click on the "older entries" link, I see the same 1 (most recent) post. And only 1 post. I want those pages to go to the 5 posts per page display. The archives pages do show 5 posts, though.

I am unsure how to do this...

Thanks for any help!
  #2  
Old Jul 30, 2009, 04:21 PM
cbmrj777's Avatar
cbmrj777
 
5 posts · Jul 2009
Just an update...

I found this plugin
Custom Query String and it works in that now the home page displays 1 post and you can click on "Older Entries" / "Newer Entries" and they go to posts that they are suppose to go to. BUT (there's that "but" again ) the subsequent pages only display 1 post when I would like them to display more than 1. Is this even possible? I know now this is a WordPress general question (not a theme question) but I was hoping someone might know the answer anyway...

Thank you!
  #3  
Old Jul 31, 2009, 05:45 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
A simpler fix would be to edit index.php and add check to see if it is the homepage i.e.
HTML Code:
	<?php if (is_front_page()) query_posts('showposts=1'); ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #4  
Old Jul 31, 2009, 10:39 AM
cbmrj777's Avatar
cbmrj777
 
5 posts · Jul 2009
Hi!

I just tried that and it didn't work. It does limit the front page to 1 post but when clicking "Older Entries" you get the same most recent single post.

Thanks!
  #5  
Old Jul 31, 2009, 11:07 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
did you remove the other things you did?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old Jul 31, 2009, 11:14 AM
cbmrj777's Avatar
cbmrj777
 
5 posts · Jul 2009
Yes... I deleted the home.php file and deactivated the CSQ plugin.

(right now it is reactivated just so my links work for visitors. I can deactivate now, though, so you can see what it does... )

Bookmarks

Tags
home page, limit posts



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Recent posts of same category, on single post pages GeoParadise Atahualpa 3 Wordpress theme 10 Apr 19, 2010 08:54 AM
Link to most recent post in page menu bar JocSch Page & Category Menu Bars 2 Apr 13, 2010 08:17 AM
recent posts in the right sidebar, but not on the home page ind Sidebars & Widgets 1 May 6, 2009 03:49 AM
Post on home page using permalinks - I have them off RickyRobi Atahualpa 3 Wordpress theme 2 Apr 9, 2009 04:33 AM
[SOLVED] How to show single post special category on static home page?? Shepherd Jim Post-Kicker, -Byline & -Footer 5 Mar 19, 2009 07:42 AM


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


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