Try this using is_single and query_vars rather than is_page:
add_action( 'pre_get_posts', 'change_queries', 1000 );
function change_queries ($query){
if(is_single() && $query->query_vars['page_id']== 'your page id'){
$query->set( 'cat', '3' );
}
}
Related Posts:
- List only child categories a post is in, of a specific parent category
- Limit function to specific post category
- How can I list random authors from current post category?
- Add icon/badge next to posttitle of specific category
- Exclude category from
- How to allow users to post only in certain category and hide elements from edit page?
- Un-highlight Blog Menu Item when Category Menu Item is Selected
- How to add content above footer in posts from specific category
- get category in list of posts // shortcode for custom related posts
- Save All Post Permalink From A Specific Category into a .txt file
- AJAX load more posts not using correct category and repeating the same few posts
- Show only top 3 posts from 3 categories in order on home page
- Filters do not work when there are multiple (one works)
- How to sort posts alphabetically based on a specific parent category
- How to add category to: ‘wp-admin/post-new.php’?
- Use category base slug in posts’ permalink
- Setting Custom Sort Order of Posts within a Category
- Display the latest post from a category in a page
- How to publish a post with empty title and empty content?
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- How to control which category will be picked for the slug of a post?
- How do I use element instead of tags in WordPress post content having webP support?
- Add default content to post (for specific category)
- Query only Posts from Both of Two Category?
- Display most recent post in category instead of archive?
- Human Time Diff, change mins to minutes
- Post in Multiple Categories to stay in current category (permalink, next previous post link)
- How to Display Post View Count
- Remove double space after a period
- get_post_type_archive_link(‘post’) returns current category archive
- Use template for posts with a particular category grandparent
- Get user’s most published categories
- Conditional that checks if a current category has any subcategory with posts
- How to set post expiration date and time and move the page to archive after expiration [closed]
- Run a function when post is deleted?
- Exclude posts from featuring
- Articles are text-only in any “Category” instead of HTML
- How To Remove Certain category Posts From the Blog Page
- Get current category id from post page wordpress
- Saving category to a post, before publishing the post
- Assign category to new post via URL
- Stop users posting into category while still seeing contents of the category
- Category Page Template not Showing Posts
- How to Restrict Previous & Next Post Link to Posts of Same Category?
- WordPress custom Query for Posts in Category display posts multiple times
- Categories list into registration form
- Force authors to Preview a post before publishing
- How to display two random-post sections that are each under their own category
- How to create a sub post?
- Isn’t the way posts are displayed very unefficient?
- WordPress bulk category select when publishing post
- Exclude some categories from listing on the current post
- how can i display my posts alphabetically?
- restrict incrementation of post vies count when refreshing the page
- Change Post Title For Specific Category
- Get post by tag
- Related Posts function not working
- the_content() Not Grabbing All Content
- In what context should Categories and Tags be used
- list posts from two categories on a page – plugin not working
- How to create a playlist for audio associated with posts per category
- Have h2 tag not show up if there are no blog posts
- WordPress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?
- Display Parent Category of a Post belonging only to Subcategory
- Can I style single post that are in multiple catergories?
- Rewriting blog permalinks
- How to make ajax load posts from the current category?
- Show single post child category from a determined parent
- How can I create a ‘sub-blog’ which has its own sidebar on individual posts?
- I want to add the 10 most recent posts under a parent category on the main menu
- how to filter posts by category without page load (ajax) in wordpress?
- How to increase the number posts that displays by a hierarchical taxonomy? (HTTP ERROR 500)
- How to distinguish pages created by woocommerce?
- WordPress the_category(); only works with message-posts not with project posts, how do I specify project categories?
- I want to show recent post according to category of the post in single.php?
- Limit amount of categories displayed in a post
- Category and Posts in front page
- Check if user has avatar
- Nothing appears using get_the_excerpt() in category.php
- Custom plugin to get related posts by category
- Unable to uncheck a category in a post
- Next/Prev category post in same button
- Run function after post is updated
- Show category post with excerpt text
- How to show different categories in different pages?
- When Author add new post change default status to pending
- fire action when post is being edited as well as saved?
- How to set a link to custom archieve page
- Getting rid of the blog page entirely
- Older entries link within a category page
- how to style an individual page in a category [duplicate]
- each user having category with their name and can add sub categories post in that category
- Can’t assign another category other than Uncategorized int he following front end post submission form?
- List posts related to category on a div [closed]
- Ajax calls in wordpress
- how to show all post with its contents
- wordpress show category link instead of post link [closed]
- CSS – Change height of Storefront / WooCommerce product categories, but not products
- How to display my categories in a list (to a post, not the sidebar)?
- How to make category for word post_content