You need to pass more query arguments. In this case you need:
$args = array(
'post_type' => 'post',
'posts_per_page' => $instance['limit'],
'category__in' => $id
);
Where $id is the category id, not the post id.
Related Posts:
- Using wp_category_checklist in a widget
- How to remove the parentheses from the category widget
- How to create a widgetized sidebar for every category dynamically?
- Customizing Default Categories Widget
- Display all posts with same title
- I want to create a posts widget and be able to select categories
- How to have Multiple Archives Widgets, one archive widget per category (in a different page)?
- Categories lose hierarchy order once assigned to post
- Add Icons to the Product Category Sidebar Widget WooCommerce
- How to display widgets inside a page content without a plugin?
- How do you categorize pages?
- WordPress category widget only show categories with children
- Customize WordPress widget – Product Category
- Post Count for Categories, however not to calculate a total
- How do I make the category sidebar widget (stock) display the total # of posts including those in subcategories?
- Categories widget show empty?
- Is it possible to remove from default category widget?
- how to remove the default title of Categories widget
- How to show 5 posts from specific category on related page?
- display a widget on specific category and its sub categories
- Multiple selection for wordpress widget
- How to Sync Menu, Widgets and other masters from Main Website to its Sub Site
- Tags Instead of Category
- How to hide widget from certain category
- Last x Posted Categories?
- WordPress category filters as subcategories
- exclude certain categories form archive widget
- Conditional widget for theme template file
- Add filter for specific category only
- Exclude a category from block editor’s category widget
- How can I display the category name in the single post when using WP Blog and Widget?
- How to Change Sort Order of default WordPress Catgory Widgets?
- How to add an “All” category to the tag cloud?
- Custom file with special code of category widget
- in_category(‘category-sluga’) returns true for Archive page of Category ‘category-slugb’
- Problem with single posts not showing correct category sidebar
- How To Disable Category Hierarchy In Categories Widget?
- single category widget with conditional terms
- Customize category query in widget
- Display posts from the same category using next/previous post link
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- Show Previous/Next Posts navigation only inside the same category
- 404 error on subcategory pages
- Add line breaks in Category description via enter
- Rewrite category slug
- View category in the preview of Theme Customizer
- Display only the latest post from multiple categories
- Get terms that are associated with products from current category
- Mass/Bulk assign categories to posts
- Duplicate Category and Page URL loads Category instead of the Page
- wp_nav_menu not highlighting the current category when viewing a single post
- WordPress order categories by ID
- ACF: Display category name using taxonomy field
- Post in multiple categories
- Mod_Rewrite to show only last subcategory in URL
- wp_dropdown_categories() scripts working erratically on sidebar
- Hide subcategories (widget)
- Access current post parent and sub category
- How to exclude the last post from a category(featured for example) from the main loop?
- WordPress Post # of # filtered by category slug
- wordpress multisite… collect all posts on main blog – exclude category?
- Automatically redirect a page to a category that share the same slug
- How to put an array in is_category
- How do I add Category Body Classes to Admin?
- get_posts() from parent category only using a shortcode
- Edit tag_id in category pages of dashboard
- wp_list_categories with category description
- WP_Query – using category__and when one of the categories is 0
- Multiple categories for one menu item?
- Exclude categories from homepage not longer working
- Remove category link
- Related posts widget – category
- Editing Loop So It Targets Specific Tags?
- Pretty URLs with Categories and Tags
- Header Link function not working. Problem with bloginfo()
- Sort posts alphabetically by category/custom taxonomy, insert divider between different types
- Need help with major category and permalink re-organization
- Include home page template in specific category template
- Modifying category order
- Please tell how to stop the category from showing up on posts
- how to get only grandchild category from a child category
- Remove “category” from permalink with add_rewrite_rule
- Next and previous links category infinite loop
- How to hook into creating a category?
- show only terms from parent category
- show posts in archive page based on selected catagory
- How to display total views of all posts of one category?
- Get the categorie name of Event Organiser plugin [closed]
- How to show “category” name?
- Display the category name of a post that is in two different categories
- filter single_cat_title avoiding the breadcrumbs
- htaccess redirect for all categories converted to tags now showing 404
- Category page with gallery for each post
- (WordPress) How to get custom taxonomy parent name?
- Search functionality with multiple categories
- Make a menu visible for a single category and it’s content
- WordPress Loop Prob
- WooCommerce category display in custom page
- How to define category ID in an array?