Your $args
array is incorrect. You used cat=-8
which is not correct here.
You will have to specify/exclude category this way 'cat' => -8
. So your $args
array will be
$args = array( 'posts_per_page' => 3, 'orderby' => DESC, 'cat' => -8 );
Related Posts:
- How can I remove posts of a certain category from homepage after a specified time period?
- Skipping first 3 posts in wp query
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Show related posts by category but ignore one category
- How can I specify a category post on my home page
- Exclude posts with specific meta_value while sorting by a separate meta_value
- prevent showing posts of an specific category in admin posts section
- How to set post expiration date and time and move the page to archive after expiration [closed]
- Exclude posts from featuring
- List posts in a given category
- how to get posts ids inside pre_get_posts filter?
- Properly display posts on homepage
- Get user categories with most posts in it
- Exclude the first ‘n’ number of posts of a tag from home page?
- Excluding posts not working
- Hide posts belongs to few categories in homepage
- Display posts of specific category term
- Migrate posts from category and sub-category via SQL
- How to get post with slug and exclude categories
- Exclude post category in a blog page
- Use posts_where to exclude posts ids from wp_query
- WP_Query of Category Not Showing First Post
- Post is in descendant category not working in home.php
- Sidebar limiting to 10 posts?
- What’s a theme that properly handles previews of different types of posts?
- Conditionally exclude post from specific category on home page sidebar?
- Query prints posts without specific categories
- Excluding category from post navigation in WordPress?
- show image gallery in archives or category page
- Page with Category Returning 1
- Get 5 most recent categories
- How can I display a specific number of post in a category via a url
- Order posts by separate menu order for different sub-categories
- Retrieve latest post by multiple categories with ID
- Make assigning post to a specific category equivalent to assigning it to all categories
- How to Include a common category in a custom Category Search
- WP_Query: Fetch posts that are in (category1 and not in category2), OR posts that are not in cagegory1
- Exclude sub sub categories from displaying in the archive page
- Exclude a ‘portfolio’ custom category?
- List posts related to category on a div [closed]
- Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]
- Filters do not work when there are multiple (one works)
- How to specify a post category for the home (posts) page?
- Exclude the Newest Recent Post from their Category After New post Publish old post should be in their category at Home Page
- How to show only homepage in google results instead of privacy, contact pages
- Display/Filter post using if else statement
- How to sort WP_Post Object array by object field in php?
- How to add class to specific navbar item when post parent category is in specific category
- Search results for ACF data
- exclude particular category in api
- On the online version of my blog posts disappear
- Multisite how to display merged posts from two sites and sort by latest date?
- Include Recent Post in Category
- How to Create another Page Category like the “Post” and “Pages”
- Current post categories and subcatecories outside of the loop
- How do you change the permalink for posts for a single category?
- Foreach issue in get_posts function
- Posts are not displaying on their category and tag page
- Make categories appear random
- how to filter posts by category without page load (ajax) in wordpress?
- Display specific posts based on an ID of another post
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- Order by meta_key field in WordPress not meta_value field value
- a WordPress connected to 2 database
- How to increase the number posts that displays by a hierarchical taxonomy? (HTTP ERROR 500)
- How to display particular set of wordpress post on a webpage?
- query posts with selected post ids first
- How to add a ‘News’ section to specific posts in WordPress
- How to Make my Homepage Display a Single Specific Post?
- how to create a category with wp_insert_post and post_category
- Make current post the homepage
- Change URL of previous posts and next posts link in WordPress
- Get Category in save_post Hook
- How to invoke a HTML custom button based on a HTML dropdownlist menu
- How to create page with post content in it?
- How to 301 redirect from url with post id to permalink with post name (slug)?
- Create/Set Category as Title of Post
- How to distinguish pages created by woocommerce?
- Order posts inside bootstrap card columns
- Exclude posts in a category on one page but show those posts on a different page
- long-title posts do not want published
- How to create a button to filter posts (list) by meta value
- How to remove a post from results by ID after query?
- Why do I have categories with duplicate slugs?
- Blog featured images disappeared on my homepage
- Blog images not showing on homepage
- How to display related post from same category in single.php
- Using a meta_value or postdate to to query and orderby
- Exclude posts in home slider from sections
- WordPress the_category(); only works with message-posts not with project posts, how do I specify project categories?
- Is there a way to save different data when USER interacts with the same POST?
- How to add a block to a category page?
- Mix post date with post meta value using WP_Query
- How to display particular categorie’s post which associated to specific user?
- Display Specific Categories posts on the home page
- How to use two query result together in one loop
- show loop id post , only first id can read
- How can I exclude a particular category from my WordPress Page 1 and Page 2?
- Save All Post Permalink From A Specific Category into a .txt file