I am trying to get the post loop widget to show just the latest 2 posts from a category
I have
post type – posts
posts per page 2
and in additional
cat=3&max_num_pages=1
The cat=3 works (takes just posts from this category), but still shows pages – how do I stop pagination appearing?
Hi Robin,
max_num_pages is a property of WP_Query and isn’t used to limit the number of results – it’s actually to work out how many pages are present. What you would normally do to do this is set a posts per page and then never actually display the pagination.
In other words, it’s up to your template to not show the pagination. If your template doesn’t include another template that doesn’t include pagination, the most you can do (outside of creating a new template – which I sadly can’t help with) would be to hide the pagination on that page. I can help with that – do you have a public URL where we can take a look at what’s going on? If you need to keep this URL private from other users, just select “Private Reply” on the bottom right of the comment box.
Alex,
Thanks for this – I’ll do work on the template