You are missing the paged=
paramter.
$myquery = new wp_query('cat=-41&paged=' . get_query_var( 'page' ));
Codex Note – You should set
get_query_var( 'page' )
if you want your query to work with pagination.
- Tip – If you want to eclude a category from main page you can use the
pre_get_post
filter. That is better way to – Exclude categories from main page
Update –
Drop in this code in your theme’s functions.php
and remove all that your customization from top of loop. (7 lines)
function wpse61695_exclude_cat( $query ) {
// making sure it runs on home page and on main query
if ( $query->is_home() && $query->is_main_query() ) {
$query->set( 'cat', '-41' );
}
return $query;
}
add_action( 'pre_get_posts', 'wpse61695_exclude_cat' );
Related Posts:
- How to fix pagination for custom loops?
- Pagination not working on home page
- WordPress category & taxonomy loop with pagination
- How do I prevent one of two multiple loops from repeating on a second page?
- Two custom loops, pagination, offset
- Previous and Next Post link doesn’t work
- Pagination adding extra posts only on page 2
- connect last post with first post
- multiple loops with pagination on the same page
- Enable infinite scroll on single.php [closed]
- How to paginate this custom loop? [duplicate]
- Make a custom loop inside single.php with pagination
- Why do I get `Call to a member function have_posts() on a non-object `? [closed]
- Pagination gives extra page with no results
- Get Pagination (WP-PageNavi) not to work
- How to get an array of years from all of the search results, and use it to filter by year the paginated loop?
- Complex query and posts pagination
- Why only one post (and no pagination) on this variation of the loop?
- Paging doesn’t work?
- Calling & display certain product category loop and pagination on the homepage
- Make blog page show 10 on first page, 9 on every other page
- Pagination for multiple loops
- How to fix pagination for custom loops?
- How can I paginate this?
- Genesis multiple category custom loop 404s after first page
- How to fix pagination for custom loops?
- Pagination – works on local but not live dev!
- How do I paginate a get_posts() request inside another page loop (Paginating childpages)
- Pagination on Single Post
- How to get my loop to paginate?
- Distribute Gallery Images Every nth in Loop
- How to exclude or filter password protected posts when using next_post_link() previous_post_link
- How to append a query string to pagination?
- How do I get my loop.php to properly paginate?
- First archive page with a few posts
- Pagination broken after using 2 loops to show content
- Pagination on custom post type on front-page.php
- I have broke my pagination, same posts on all pages (index.php)
- Frontpage pagination by week
- Can’t get the previous and next posts permalink
- How can this multiple loop have pagination as described?
- Display more than 10 posts on author.php file
- static page with multiple loops breaks post pagination
- Pagination for two loops
- Page Navigation Outside the Loop
- Skip 5 latest post while paging?
- Why does my WP_Query pagination on a custom page.php only loads the homepage?
- White screen of death on index.php page 3 and above?
- How to insert content before pagination in loop?
- Pagination on a underscore custom theme
- WordPress multiple loops with default pagination
- How to fix pagination for custom loops?
- Style first 3 posts differently and use a 2nd loop to get rest of posts / offset and pagination broken
- Custom loop not working in singular.php, working in other pages
- Alternative layout the loop
- Loop within category’s posts
- How to fix pagination for custom loops?
- Adding pagination to WP_Query [duplicate]
- How to fix pagination for custom loops?
- How to fix pagination for custom loops?
- Why is my pagination showing up?
- Displaying posts limit: can’t get pagination to display [duplicate]
- Paged homepage – requirements?
- Home page loop with pagination problem
- Previous Posts Link and Next Posts Link Show All The Same Articles?
- WooCommerce custom loop pagination on front page
- Custom Page Template and Category Exclusion
- repeating posts on 2nd page to posts
- Limitless amount of posts in custom archive page
- Same posts within a paginated page
- Multiple loop with pagination in same page
- Insert multiple custom components after x-number of posts
- A search for ‘0’ returns results
- Custom Loop and Infinite Scroll
- Loop that displays PARENT PAGE & CHILD PAGE & outputs GRANDCHILD PAGE title and content
- How to order posts by meta_value created inside loop?
- Five posts from a category in footer
- Problems with loop
- Pagination Issues using WP_Paginate Plugin
- Display Authors in a grid loop
- Custom Theme With Custom Loops
- How to show more random posts if Tag has less than 3 posts
- Is there any good reason for two CSS files to @import each other?
- how can i order the category by date
- excerpt not showing up
- Announces with different formatting dependently on a number
- Override orderby to create list of users by custom meta_value
- List page is showing 404
- Duplicated tag in loop
- Why is my archive page looping through all but one post?
- Loop two different category WP_Query
- Post navigation doesn’t show (in custom template, custom post type, custom query)
- adding tax_query to $query_string
- Remove posts_orderby filter then add it back in
- the_title() Returns the page title instead of the post
- How does the JSON API work to parse incoming JSON and fetch a post based on an ID?
- How to add excerpt in loop in Twenty Eleven theme?
- How to inject a post within a loop
- How to implement template file and the loop
- Show only posts from todays date [duplicate]