More than 2 posts on main page
Hello,
I'm trying to create more than 2 posts on the main page. It seems all hemmingway can hold are 2 posts and when you add a third one, it pushes the oldest off into the archives and just leaves 2.
Is their anyway through wordpress to change this? or through wordpress css?
Thanks!
2 Posted by Justin Young on 11 May, 2009 07:22 PM
You have to go into the index.php page, and look for this line:
<?php
Change 'showposts=2' to however many posts you want to display
3 Posted by Jack Spratt on 15 May, 2009 08:56 AM
Making this change to ./wp-content/themes/hemingway/index.php didn't work for me. Can't for the life of me figure it out.
4 Posted by Jack Spratt on 15 May, 2009 09:16 AM
It works when I change it to 1. But 0 or 3 don't.
5 Posted by Oskar on 19 May, 2009 05:42 PM
It's because you need to change the if-statement in line #13 as well. Change it to the same number.
6 Posted by Alex Maiorano on 07 Jun, 2009 02:53 AM
Hi and thanks for the fantastic theme.
As above I'm having issues getting 4 posts to display using the above edits. When I do the fixes above ie8, ff and safari all have issues displaying posts in the normall order. I end up with the original 2 as per defaualt and the next 2 post on the left hand side.
I know my explanation sucks but I'll keep the site up with these errors that you'll no doubt see once you take a look.
Any help would be greatly appreciated. Thanks again for your time.
7 Posted by Jack Spratt on 07 Jun, 2009 06:13 AM
Thanks Oskar.
8 Posted by Alex Maiorano on 09 Jun, 2009 02:00 AM
It seems that jack got this working though I still have the same problem above. Jack, would you care to elaborate?
Cheers,
9 Posted by Oskar on 09 Jun, 2009 06:18 AM
Alex,
Check post #1 and #4. Those are the only needed changes. Hope it works for you.
10 Posted by Alex Maiorano on 09 Jun, 2009 06:49 AM
Hi Oskar, I've made those changes a number of times as detailed below but it still displays incorrectly.
my site is at http://smoothunit.com , if you would be so kind to take a look. I've made no changes whatsoever (other than below) that couls cause a conflict.
<?php
Thanks again.
11 Posted by Brent on 19 Jun, 2009 07:10 PM
Hi Alex,
I had the same issue, but found the solution.
The problem is caused by the CSS class. Specifically, the variable $first is being used to give the first post a different class to the second post. The problem is that the logic doesn't account for more than one post.
This is easily fixed. Change line 22 from:
<?php $first = false; ?>To the following:
<?php ($count % 2) ? $first = false : $first = true; ?>Enjoy!
12 Posted by Brent on 19 Jun, 2009 07:17 PM
PS - depending on the length of your captions, you may also need to change the CSS for the "first class".
Just add "clear: both;" to style.css as below.
13 Posted by Alex on 20 Jun, 2009 02:21 AM
Hi Brent,
Thank you for taking the time to reply and provide a definative fix. All is perfect.
Thanks again mate.
14 Posted by andywd7 on 08 Sep, 2009 11:56 PM
Hi there!
Don't know if anyone is going to see this as it's a bit of an old post but anyway!
I'm using Hemming way with white.css and thanks to this post managed to change my posts from 2 to 4! But my first post won't line up with the other post above it in the left column and is shifted to the right slightly! It leaves a huge gap above it where it should go!
Any ideas or a solution would be really appreciated as this is the only real thing I want to change on this theme!?
Thank you
15 Posted by andywd7 on 08 Sep, 2009 11:57 PM
missed the link:
http://www.andkern.com
16 Posted by Brent Shepherd on 09 Sep, 2009 12:59 AM
Hi Andy,
The alignment issue is being caused by the variation in your heading lengths. Specifically, one is going onto a second line while the other is not.
Knowing the cause of the problem, you can either make sure all headings are an equal number of lines, or you can alter the CSS so that regardless of weather a heading is one, two or three lines, the heading element, or post div doesn't get any larger.
I'm struggling to type on a tiny little netbook so can't really play around with the css now to provide a workable solution haha, sorry! But it shouldn't take too long if you're using firebug in firefox. :)
Best of luck.
Brent
17 Posted by andywd7 on 09 Sep, 2009 09:58 AM
Hi Brent,
Thank you for your reply. I changed my heading lengths before I went to edit my css and made sure all headings were one line just to check this was the problem and unfortunately it didn't change anything!? The problem still remains!
Any ideas? or do I have to definately make the change in css for it to take afffect!? If so could you please advise me of where and what needs changing as I am really not sure!?
Thank you very much
Andy
http://www.andkern.com
18 Posted by andywd7 on 09 Sep, 2009 11:18 AM
I think I know what the problem is unfortunately! (Don't think there is a too simple enough answer!)
The problem is with the 3rd post, it needs to have the same properties as the 1st. At the moment it acts as the 2nd and the 4th posts in the right column, which have a margin or padding to add a gap between them and the 1st and 3rd posts in the left column!
So I think I know what I need to do, create a 3rd post div in css and make it take effect in the index file, I just don't have a clue how to do it!?
Please help or correct me if I'm wrong!?
Thank you
http://www.andkern.com
19 Posted by Brent on 09 Sep, 2009 06:19 PM
Andy, if that's the case, you haven't read comment 11 or followed the instructions in that comment. Changing this line will make sure that the "first" class is added to each first post that should show in the first column.
20 Posted by andywd7 on 09 Sep, 2009 06:57 PM
Thank you! Sorry but this hasn't quite changed it! The 2 posts in the first collumn are inline with eachother now but there is still a huge gap above the 3rd post!? if I do the change in the css file as in post 12 it puts them all into one left sided column!?
Don't know what still needs changing to make this work?
Thank you for your help and patience!?
http://www.andrewdenham/blog
21 Posted by andywd7 on 09 Sep, 2009 09:42 PM
sorry
http://www.andrewdenham.com/blog
22 Posted by IT News on 18 Sep, 2009 11:21 PM
don't worry
http://itnewstech.wordpress.com/2009/09/19/post-on-main-page/
23 Posted by Angie Handley on 09 Nov, 2009 01:13 AM
I also would like more than two archive posts to show at once, however, I am on Wordpress.com. Should I assume there is no way to fix it via CSS alone?
:/
Angie :)
(silveroakarticles.wordpress.com)
24 Posted by warspire on 28 Dec, 2009 02:47 AM
Comment#11 is on the right track. You do need to update the
$firstvariable as it helps place the CSS class for the layout.However, you need that block of code to be INSIDE the loop.
The updated section of code in question should look like this.
My code shows 6 posts. Put in your own number in both places for your own edits.
25 Posted by habacuque Lima on 02 Feb, 2010 04:13 PM
Thank you Brent!
It's working perfectly for me now.
26 Posted by Nemanja on 20 Feb, 2010 05:31 AM
Thank you Brent and Charlie! This thing was irritating but it is solved now.
27 Posted by Alex on 19 Mar, 2010 08:58 PM
Can sombody finalise this? (Or look at mine and help me fix it?)
I'm having a problem levelling the posts.
http://www.alexjhall.com/
Here is the code:
query_posts('showposts=4');
28 Posted by Habacuque Lima on 19 Mar, 2010 09:22 PM
This is the way it worked for me:
<?php
29 Posted by Alex on 19 Mar, 2010 09:55 PM
Hmm, doesn't work and I just get the error message. Obviously you have changes elsewhere in another script that are relevant to your above coding.
30 Posted by Alex on 19 Mar, 2010 10:09 PM
Got it. It was clarified in #24. I tried it earlier and got an error, seems like the annoying // Here is the call to only make two posts show... got in the way.
31 Posted by Charles Goldberg on 10 Jun, 2010 04:56 AM
Hi -
I'm new to blogging. I love this format on wordpress but like everyone else here I'm wanting this page to display ten posts. Why I'm different than everyone else here is I have no idea how to access the index.php thing nor do I know anything about CSS or website design. Still, anyone's help or guidance would be deeply appreciated. Thanks.
www.hardcharlie.wordpress.com