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)
- Keep featured content post in homepage with original order
- Including categories in search results
- Adding additional data to WP_Post object
- Convert custom fields to post categories
- Query posts from current year
- Most viewed post for the last 2 days using WP_Query
- Do I use custom post type or something else?
- Limit function to specific post category
- wp query with dynamic taxonomies and terms?
- How do I use `posts_distinct` correctly?
- Automatic value for custom fields for posts
- Loop through all product posts?
- How to display related posts by subcategory and not parent category
- How to find what index page a post is on?
- Category Template: Need to display different content on first page of archives
- Get Posts that are in the current month or later
- WP Query to Get Array of Slugs
- How can I sort posts by the date and a custom meta field?
- Hiding Draft Post In Admin
- How to limit posts by category
- How to list recent posts in a wp nav menu?
- Dynamic dependent Dropdown lists for categories, sub-categories and posts
- List authors with the last post title and order by last post date
- How to order posts by meta_value and title
- WordPress query_posts by tag doesn’t work anymore(?)
- why does wordpress ignore the post args?
- Ignore latest two posts
- How to create a “latest news” page showing a list of posts from blog category
- How can I insert a new markup element after 4 posts automatically? [closed]
- How to have more than one page for your posts if you have 8 posts but can store max 4 on a page
- Extract wordpress posts content and category content
- how to handle the loop using filling bootstrap grid structure?
- How to display WP Query filters?
- Finding a post’s slug
- How do I display main query posts in random order using add_filter
- Does having category name in permalinks affect SEO when having a post in multiple categories?
- query posts with selected post ids first
- How to Make my Homepage Display a Single Specific Post?
- How to display related post from same category in single.php
- Save All Post Permalink From A Specific Category into a .txt file
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- get current index of post content in category page
- wp_query args with relation
- Dynamically load posts based on category
- Get Categories & Posts With Type Article
- Set multi posts random categories and tags
- Add new post only in assigned category
- Creating Ordered Query using Meta_key
- How to remove related post from home page
- Admin Post List Only Show One Category
- WP Query between posts custom fields [duplicate]
- Same sidebar in all posts as in the category
- How do I list categories and the common categories for posts beneath those categories?
- Update Post with Modified Data
- wp_query select if have comments
- wp_query posts sorting doesn’t work
- Listing category and its posts one by one
- Site ‘Categories’: save an admin global setting with post metadata [closed]