Generally, I love to try and figure things out for myself.
This one has been trouble and a couple hours and several articles later I still can't seem to get my head around the solution.
Problem
I am coding up a WordPress theme - usually, I could do it fine. This design calls for the top story to be singled out and styled differently, and then the next four posts pulled out and treated regularly offset by 1, effectively).
I have the partial solution already..
Main story:
And for the next four posts:
However, this isn't inside the regular Loop, and it gives me the same page for every page except the single (obviously, because the post treatment is hard-coded). When I try to put this inside the The Loop and still make it work I get a blank page.
In effect, I just need to have the above functionality inside the WordPress Loop so I can still have regular blog interaction. I know it's got to be a simple answer, but I can't seem to get it working (probably my head cold holds me back some also)
Thanks!
This one has been trouble and a couple hours and several articles later I still can't seem to get my head around the solution.
Problem
I am coding up a WordPress theme - usually, I could do it fine. This design calls for the top story to be singled out and styled differently, and then the next four posts pulled out and treated regularly offset by 1, effectively).
I have the partial solution already..
Main story:
Code:
<?php
$postslist = get_posts('numberposts=1&order=DESC&offset=0');
foreach ($postslist as $post) :
setup_postdata($post);
?>
And for the next four posts:
Code:
<?php
$postslist = get_posts('numberposts=4&order=DESC&offset=1');
foreach ($postslist as $post) :
setup_postdata($post);
?>
However, this isn't inside the regular Loop, and it gives me the same page for every page except the single (obviously, because the post treatment is hard-coded). When I try to put this inside the The Loop and still make it work I get a blank page.
In effect, I just need to have the above functionality inside the WordPress Loop so I can still have regular blog interaction. I know it's got to be a simple answer, but I can't seem to get it working (probably my head cold holds me back some also)
Thanks!