Try replacing your code with the following:
$wp_query = new WP_Query();
$wp_query->query( array( 'cat' => '9', 'posts_per_page' => get_option( 'posts_per_page' )));
Related Posts:
- How to get the number of posts in a selected category?
- MySQL Query to Retrieve Category from wp_posts
- Category checkbox list tree changes when editing a post
- Show related posts by category but ignore one category
- How to sort posts by last name (2nd word) on ONE category only?
- Single.php Active Category Class
- Most efficient way to list all categories and display a post for each of them?
- prevent showing posts of an specific category in admin posts section
- Add custom field to category of custom post type
- Can I hide a specific post from latest posts page?
- Auto set Post to Specific Categories
- How to show post(excerpt) from specific category on wp page?
- New blog template to display only one category
- WordPress – Admin Manage Posts – Multiple Filters by Parent Category
- Custom Theme Want To Remove One Category From All Displays
- Divide Loop Into Days & Categories
- How can I list random authors from current post category?
- Different template for posts of all subcategories of category
- Mark menu item as current-menu-item for category
- How to set up multiple taxonomies for groups of posts
- How to filter posts that belong to a specific category only if that is the only category
- Category List (Archive) Page Template By Category
- List posts in a given category
- How to display category from recent posts?
- Can I divide the pages into categories?
- Child_of not displaying all children posts.. via get_posts
- Duplicate posts and change category
- Category Foreach keeps looping?
- display a random post thumbnail from a random category
- How can i limit the number of posts created per category?
- Post page to display specific category
- Get Posts Under Custom Taxonomy
- Prevent additional top level categories but allow more children
- how to show single post in a custom template
- How can I hide tags on a child-category page, if that tag has not been used?
- How do I stop the loop from repeating in my category template?
- Excluding posts not working
- Hide posts belongs to few categories in homepage
- post category in wp_insert_post
- Limit the number of posts a category can have – newest post goes in, oldest one drops out, possible? plugin?
- Remove current category from post but display all others
- Display posts of specific category term
- Widget that shows categories with posts numbers
- How do I show posts from another wordpress installation?
- How do I include the category next to the title of a post?
- Relative number of post in category
- How to show a custom taxonomy in the theme?
- How to import nested categories from XML file?
- How to get post with associated categories and tags names instead of ids with rest api?
- Migrate posts from category and sub-category via SQL
- Posts Missing in Dashboard after update
- Display post number by category
- How to get post with slug and exclude categories
- Retrieving posts by their date and category
- Are post, page and category IDs unique to each other?
- Static pages not working
- WordPress displays post on subcategory only
- How to list post as buch of category, and all of them
- How can I add a page that shows posts from a single category?
- Post in bulk based on category template
- Remove subcategory slug from url
- Can I show category name in url for only one of my categories?
- Automatic duplicate/copy of post to a related page in WordPress
- get category in list of posts // shortcode for custom related posts
- Is there a way to categorize a list posts all at once?
- Yoast breadcrumb URL shows category instead of the page
- Featured Story Shortcode not outputting content
- On the online version of my blog posts disappear
- Current post categories and subcatecories outside of the loop
- Query prints posts without specific categories
- Foreach issue in get_posts function
- More Than 50K Categories and WordPress Admin Panel Stop Showing Categories and Posts
- Re-order Category Meta-data
- Custom post styling per category?
- How to run select query of post with category and tags?
- post categories – how to show only categories with a specific parent id
- Creating a “category” of featured posts
- How do I make it so that new posts within a certain category go into a certain page?
- Point users to a specific url directory for some posts
- List Authors For Current Category
- Static text above category page
- List posts of assigned categories in list of all categories on single.php
- Assign specific ads to specific categories/posts
- find posts with exactly 3/4 categories
- Use radio buttons & checkboxes for post categories
- Delete old post with new post
- Displaying only posts from a certain category on my custom page template
- I need to create a page or post hierarchy
- Separate categories parents, childs and grandchilds in dropdowns
- WP_Query: Fetch posts that are in (category1 and not in category2), OR posts that are not in cagegory1
- Add default content to post (for specific category)
- List posts that are in the same category as the current post title
- Multiple blog “feeds” in a single blog each with distinctly styled post pages
- How to get pagination working with “Pending” Posts
- Taxonomy Category category.php not working
- Post’s arent displaying
- Show with echo if a post has two or more categories
- How can I get on the same row two post of different categories?
- wordpress category Description not allowed tag
- Site ‘Categories’: save an admin global setting with post metadata [closed]