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?
- Using wp_list_pages() after calling query_posts()
- 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
- Why are my paginated posts always returning the same results?
- Inner join overrides Advanced Custom Fields plugin’s get_field [closed]
- Widget that shows categories with posts numbers
- Can’t understand why sometimes a [caption] field appears
- Relative number of post in category
- How to get post with associated categories and tags names instead of ids with rest api?
- Display a mixed list of posts and media
- Why in my query is display two title?
- How to convert query sql to shortcode in wordpress?
- Inserting an example of the last 3 post on to the homepage
- 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
- Is there a way to categorize a list posts all at once?
- Change Old WordPress Post Date Year
- Yoast breadcrumb URL shows category instead of the page
- Display/Filter post using if else statement
- On the online version of my blog posts disappear
- Current post categories and subcatecories outside of the loop
- Foreach issue in get_posts function
- Numbered Pagination Showing The Same Posts After Altering WP_Query
- How can I exclude a particular category from my WordPress Page 1 and Page 2?
- More Than 50K Categories and WordPress Admin Panel Stop Showing Categories and Posts
- Re-order Category Meta-data
- Custom post styling per category?
- Manipulate query to show specific post
- 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?
- WordPress text field in array problem
- Only show current category post
- Random order of the 5 most popular posts
- My custom query is displaying random posts in random order
- List Authors For Current Category
- Get query result according to merged array
- List posts of assigned categories in list of all categories on single.php
- How to show the posts list into a static page? Problems to use the loop into a static page
- Assign specific ads to specific categories/posts
- Displaying Results From Custom Taxonomy Query
- find posts with exactly 3/4 categories
- Multiple loops on a Search result page?
- Use radio buttons & checkboxes for post categories
- Displaying only posts from a certain category on my custom page template
- 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
- 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?
- How add class the_content();?