andrewplatham
Member
Posted 1 year ago #
I'm trying to use PageofPosts to display the latest news on my site from the category titled "latest-news"; category # 3.
This is the code I'm using: http://wordpress.pastebin.com/8gYJm696
And this is the result: http://www.shrimpalliance.com/new/?page_id=550
This is what is currently on the site, and it's working fine, except I can't figure out how to only put the latest four posts:
http://wordpress.pastebin.com/gAq1fVSD
And this is the result: http://www.shrimpalliance.com/new/?page_id=84
So I'd love to either fix the current (messy) code I have to display only 4 posts, or get the newer one I'm working on functional... and I just can't see where I'm going wrong with this newer one.
Thanks!
ps - yes, I know that image link on the side is broken... fixing that now. :)
andrewplatham
Member
Posted 1 year ago #
Hi Alchymyth. Thanks for that!
I have: query_posts( 'posts_per_page=3' );
on what line of this code can i place it?
http://wordpress.pastebin.com/gAq1fVSD
Alternatively, would you know why this isn't working?
This is the code I'm using: http://wordpress.pastebin.com/8gYJm696
And this is the result: http://www.shrimpalliance.com/new/?page_id=550
I have: query_posts( 'posts_per_page=3' );
on what line of this code can i place it?
try and add 'posts_per_page' to the $args of the query (line 46++ in your first pastebin)
$args = array(
'category__in' => $cat,
'caller_get_posts' => 1,
'posts_per_page' => 3
);
Alternatively, would you know why this isn't working?
i get 'page not found' for the link
andrewplatham
Member
Posted 1 year ago #
try and add 'posts_per_page' to the $args of the query (line 46++ in your first pastebin)
eek. that broke the page... made it completely blank.