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 --> Code:
<?php /* If there are any 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! :) |
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 :p ) 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... :o Thank you! :) |
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'); ?> |
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. :confused: Thanks! |
did you remove the other things you did?
|
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... ) |
use this, it works
HTML Code:
if (is_front_page() && !is_paged()) query_posts('showposts=1'); ?> |
That sorta works but when you click "Older Entries" it skips 9 posts (posts #265 to 281) then the 11th most recent post...
|
Yup, your right and at this point I've spent too much time on this. If you want me to look into it more send me a PM and I'll quote you a price.
|
Hello, thanks for the info above very helpful.
However, i don't want the full post to be displayed, instead i need the post to stop at the 'continue reading point'. So basically i want to show the most recent 'multi page post' on the home page. Any ideas? I've spend the last 4 hours trying stuff out but nothing is taking. Thanks so much my url: http://www.marcowens.co.uk/wordpress/ |
Have you tried using the excerpts field on posts and played with the setting in the excerpts options of the theme?
|
Thanks for your reply.
Yeah, i've tried changing the settings, but as i understand there is a difference between a 'multi page post' and an excerpt. Am i right in thinking this? Any other ideas? |
I had the same question for my website.
http://coffee2code.com/wp-plugins/custom-post-limits/ should sort you out! -d www.tiredofit.ca |
Quote:
|
Basically i am just looking to get the most recent post (as it appears here http://www.marcowens.co.uk/wordpress/?page_id=2 on my blog page) on the home page here http://www.marcowens.co.uk/wordpress
Currently it shows the whole post but i just want the bit before and including 'continue reading' Just cant work it out. Any help would be amazing Thanks so much. |
In ATO>Configure Excerpts how do you have "Posts or excerpts on HOME page?" set?
|
I have just changed it but this is not what i am looking for.
It only shows an excerpt. Look:http://www.marcowens.co.uk/wordpress/ What i am looking for is a single post that looks like one of these: http://www.marcowens.co.uk/wordpress/?page_id=2 Not the same thing right? Any ideas? |
You might have to use a featured image or put <img> in the "Don't strip these tags" box in the configure excerpts section.
|
All times are GMT -6. The time now is 03:11 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.