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 can i limit the number of posts created per category?
- How to do set post permalinks using 6 digit random unique function?
- Can’t get buddypress notifications in front-end; why do I get this error?
- How to Restrict Previous & Next Post Link to Posts of Same Category?
- Pulling in post category and children within category
- WordPress custom Query for Posts in Category display posts multiple times
- Post categories to pages
- Get user categories with most posts in it
- How do I display some posts fully on the homepage, and some as an excerpt only?
- Post page to display specific category
- Get Posts Under Custom Taxonomy
- Get attachments for posts that belongs to a specific category
- Prevent additional top level categories but allow more children
- Need help with category listing!
- Prepending %category% onto default posts fails
- List all categories with featured image from post?
- Categories list into registration form
- Send post id through ajax and get the post content back
- WP_Query: Mixing category__in and tag__in together
- If in_category not working for multiple single.php pages
- How can I setup a relationship using categories in WordPress?
- WordPress Multisite – Create Default Post and New Category On New Site Install
- how to show single post in a custom template
- Using ajax on editing a category edit page?
- Related posts by category not working right
- How to list recent posts in a wp nav menu?
- Display post x of y within category
- Force authors to Preview a post before publishing
- Set Default Category to Username
- WordPress Automatic Filename Changer
- Disable sticky option for specific categories
- Dynamic dependent Dropdown lists for categories, sub-categories and posts
- How can I hide tags on a child-category page, if that tag has not been used?
- date issue with category post retrival
- Listing Specific Categories from Current Post with Depth
- How to make multiple sections in home pulling posts category wise?
- How to display two blog categories as separate sections on one page?
- How to make the first post in the loop be styled like a “new / featured” post?
- How to Mysql select a list of posts with meta_values AND all relevant categories?
- Redirect to another page using contact form 7? [closed]
- Display post category in foreach loop
- Single.php – Get Current Parent Category
- Order posts alphabetically: how to set order=asc in mysql query?
- How do I stop the loop from repeating in my category template?
- get_the_category listing in hierarchial order
- Is it possible to add/tick a category to a post when it is created?
- Excluding posts not working
- Hide posts belongs to few categories in homepage
- why does wordpress ignore the post args?
- 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?
- How to get subcategories from category slug?
- Remove current category from post but display all others
- How show categories in admin and get that selected to show posts in index
- Change all author links in Blog roll
- disable Tab post on nav-menus page (Admin)
- Showing categories and subcategories with posts
- Change default category when I publish a post
- store posts_id of category into a varable?
- Adding bootstrap classes to video shortcodes
- How to display two random-post sections that are each under their own category
- How can you display all sibling categories to a post?
- Every second post different class in blog view
- Format latest/newest post differently
- Loop doesn’t exclude the specified category in home page
- is_page Funtion for Posts ?
- Display posts of specific category term
- Post type no single page
- Widget that shows categories with posts numbers
- How to create a sub post?
- Post Image not displaying in category view
- Showing custom post type categories in the menu
- How do I show posts from another wordpress installation?
- Get post meta retrieving wrong value
- Adding a user’s ID behind the tag ref link address
- get posts from Custom Post Type & Category
- The_excerpt() doesn’t parse – how to change that?
- Category page when using static front page
- Latest posts by category — how to exclude current post?
- How to only publish posts with image in it
- How do I include the category next to the title of a post?
- Relative number of post in category
- Isn’t the way posts are displayed very unefficient?
- How to create a “latest news” page showing a list of posts from blog category
- WordPress bulk category select when publishing post
- Exclude some categories from listing on the current post