Try creating a new instance of WP_Query and at the end use wp_reset_query(); like this:
<?php
$my_query = new WP_Query();
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$my_query->query('cat=". $id ."&posts_per_page=4&paged='.$paged);
while ($my_query->have_posts()) : $my_query->the_post();
?>
<?php get_the_content() ?>
<?php endwhile; ?>
<?php if ( $my_query->max_num_pages > 1 ) : ?>
<?php previous_posts_link( __( 'Previous', 'themename' ) ); ?>
<?php next_posts_link( __( 'Next', 'themename' ) ); ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
Related Posts:
- Display posts from the same category using next/previous post link
- How can I create a category landing page followed by pages of posts?
- Display all posts from all categories with pagination
- Show Previous/Next Posts navigation only inside the same category
- Page navigation within a category
- Show posts of one category only with Custom Taxonomy on single.php
- Pagination on child category returns 404
- Disable pagination only for specific category
- Archive pagination causing 404 with permalinks structure
- Custom category template pagination problem
- How can i call an article from each category and still paginate properly?
- Show posts of category in a page
- Force category-slug.php to show page, even if it doesn’t exist
- Pagination Not Working on Category.php page
- 3 Columns, 3 Categories, One Archive, and Pagination
- ?cat=-1 Indexed Versions Of Homepage
- Pagination for category slug returns 404 when page >= 2
- Pagination not visible on woocommerce’s category page
- Pagination is not working properly in Product Category/Tag pages
- Restoring default article pagination on archives – Removing custom limits
- The default code for “posts_nav_link” on category.php isn’t working
- Why category.php throw 404 in wordpress while calling paginate_links()?
- Paging not working in category.php
- How do I toggle pagination on/off in search results and category listings via a link?
- Multiple Loops on category.php with pagination on last loop
- Custom post and category template pagination problem
- How to make the link to the category for a post go to corresponding page number in archive?
- Category archives with monthly pagination
- category pagination got broken suddenly
- Pagination for ajax category filter
- Category template with pagination returns 404 on next pages
- How to display numbered pages in a category
- WordPress alphabetical A-Z custom post type post result display
- How to show 1-5 of X Total Results
- Pagination on category.php and tag.php not working
- How to do paging in the loop?
- Pagination for query_posts();
- Having problems with paging
- Pagination doesn’t work on multiple categories
- Pagination breaks on child-categories, works fine on parent-category
- Pagination for a category
- Can I define multiple paginations on a single page?
- Conditional category query breaking?
- Category pagination not working
- How do I remove pagination from just some Categories?
- Problem with pagination block in Gutenberg
- Show the number of the post
- pagination 404 error, same slug home and categories
- Pagination for custom categories template
- Remove WP Core canonical for category pagination
- Unable to create pagination for Category.php
- Pagination does not work with query_posts()
- “Next posts” of a category do not call category.php
- WordPress pagination based on category
- How to add Pagination to foreach loop to page
- Removin /page/2 from pagination
- WordPress pagination not working because of subcategory
- Loop within category’s posts
- Paginations in Category Page Leads to Sample Pages
- Category foreach Paging
- Transfering static site to wordpress and retaining category by month paginations
- WordPress Numeric Pagination with Query String [duplicate]
- date.php shows all posts. how to fix it?
- wordpress category.php query for featured news item, broken pagination and repeating posts
- Paginating a list of all posts collected by category titles
- Paginate WordPress Category Pages
- Using pagination with multiple loops causes it to break
- Showing one post from each category, paged?
- Why Pagination is not working on Category.php
- Can i know if it is Category first page or 5th?
- Exclude posts from certain category breaks custom pagination
- Category pagination not working in category.php please help me
- i want to add pagination list of categories
- Link to page in category
- How can I implement pagination on custom category page?
- wordpress category rewrite rule with pagination
- Make parent categories not selectable
- Can I use get_adjacent_post for specific categories?
- Accessing WordPress MySQL Database via Data Connection in Visual Studio 2010 using C#
- Extract image url associated to a category
- List Sub-Categories of a Parent Category
- add text to the top of category page
- display posts from specific category on a page , in thematic child theme?
- Latest comments from each category?
- Categorie parents and childs displayed
- Link To Child Category For A Post
- How can i change what one category displays?
- How do I change the category permalink structure?
- How to display post in custom file not in archive file?
- Setting the Primary Category for a Post Based on Context
- Automatically adding tags and categories into Post Excerpt for searching
- Allow Custom Role to edit a custom post type category
- How to prevent tag “iframe” from being deleted from the heading description of rubric?
- How can I make a category function as a page?
- How to add custom option to wp_dropdown_categories?
- Renaming default category taxonomy?
- Profiling user with categories
- Hide category name in URL
- Modify functions.php to add a term ‘uses-theme’ set to theme name on post save
- Moving Blog and Changing URL