September 16, 201115 yr Hey, My mate has a website with loads of blog posts. On the first page, it shows the first 5, then uses pagination, to go further back. I made a simple loop, so that the first post shows all the content, and then the rest just the excerpt. First problem (not major). But everytime the page goes back (so page 2, 3 etc) the first is still showing the full content (as the loop counter resets). Does anyone know a way around that? Second (biggest issue): He wants to exclude some posts from the main blog roll. So he made a new category called 'Exclude' (ID = 771), and before the blog roll loop stars, I put in: <?php query_posts( 'cat=-771' ); ?> This works, however now the pagination doesn't. So clicking "Older Posts" changes the link so page-2, however the posts (5 latest) dont change. Sorry for the ramble, any help would be awesome
September 16, 201115 yr query_posts tends to replace arguments rather than adding to them. Try: $args = array( 'cat' => '-771'); query_posts(array_merge($args, $wp_query->query)); Should sort out your pagination. First post needs to test for $_GET['paged'], which is the var WP uses. Edited September 16, 201115 yr by Renaissance-Design
Create an account or sign in to comment