To exclude a category, you need to know its ID. You can then exclude it like this (please not the minus before the ID):
$args = array( 'posts_per_page' => 4, 'cat' => -the_category_id_to_put_in);
The WP Query class reference has more information if you need it: http://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters
Related Posts:
- Mega Menu Walker
- How to call a function only once (global variable scope)
- Multiple is_page() in page.php
- Set media upload attachment link to none and hide it in WP v3.5
- Fatal error: Call to undefined function plugin_dir_path()
- Switching wp_get_sites to get_sites
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- How to correct schedule my event weekly with wp_schedule_event()
- One button to change all settings in theme customizer?
- Add custom image sizes to media uploader
- Execute a shortcode when clicking on a image
- How can update custom meta for all posts
- How to add default images into theme customizer image control?
- Is $hook a global variable in WordPress
- Successful or Error Message after running mysql code in functions.php
- Custom Logo URL | Help me print the URL of the custom logo I inserted into my theme
- wrong php date()?
- Include a php file from functions.php only to homepage
- How do I fetch all comments per post via WP REST API?
- Shortcode content output but not in correct place
- How to restrict page access to logged-in users?
- How do I display a user’s previous orders as a select box option on a product?
- Handling Body class based on Template
- Adding Default Settings to Theme My Login plugin
- How to combine wordpress_logged_in cookies in one cookie?
- Two Different Links for Same Product – WooCommerce [closed]
- Automatically adding new post categories to menu
- Get post id in a function when edit/add a post
- function to assign user role based on a field from usermeta
- get author_name from queried post
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- Pass php dynamic variable to shortcode
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Modify custom field input data before creating a new post
- Query Pages and post excerpts dynamically
- Is there a way to conditionally check whether a WordPress post title is empty?
- Error call_user_func_array() expects parameter 1 to be a valid callback when using image_size_names_choose
- Run a code only on theme activation only during first activation
- Shortcode from a function not working
- Is it possible to return content, and then also continue to do other things?
- How to remove ?p= from wordpress short links
- Creating WordPress Shortcode with Variable
- Add meta tags to a custom header
- Need php code’s output to display underneath a Divi Module
- WP_Query | IF within $args array | Help me only add specific arguments if the argument is not blank
- How to make function appear in sentence?
- How to define a variable already defined in a plugin function?
- woocommerce specific quantities for product
- How to use mysql LIKE with wpdb?
- woocommerce related product title length
- Custom query vars filters problem with pagination
- Function sanitize_title() does not appear to be working
- Query for user roles
- Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS
- Must filter functions receive all arguments passed to them?
- Displaying Event within two given time frames
- Displaying Slider in Front Page (home) using Customizr Theme
- How to prevent a function from running based on host (ie web vs local)?
- How to call custom function outside from the admin page?
- Is there a way to create a “copy post” link?
- Taxonomy term description with style, only if the description exists?
- Use of antispambot with $curauth->email
- Restrict post to current user in postmeta
- Delete images from media library when user deletes an image from ACF Gallery
- Reject all malicious URL requests functions.php
- copy fields value to another field
- posts_per_page displays only 2 posts instead of 4 posts
- Get parent category name when only child category is applied to a product
- Notice: Undefined variable
- Adding product permalink on admin order page throwing error
- Before & After Content – After Content directly below Before Content when using require_once
- How to override WooCommerce Order Item Meta with data from Cart?
- Taxonomy Child Term, Counter is staying on 0
- Access to “My Site” is missing from the admin bar
- How to redirect (301) trashed post to it’s parent taxonomy TERM ARCHIVE instead of 404 page
- How to call WordPress PHP file using external js file
- Need help with PHP functions
- Using get_theme_mod with checkbox to display content
- use system script advertising in wordpress multisite
- WordPress styling recent post
- Styling admin page rows in order of importance (checkboxes)
- Insert wordpress tags below posts via functions.php
- Help with my first Metabox helper class
- Break a WordPress function to run in patches and re-continue
- Pagenav Not appearing on custom Template
- ISOTOPE – Missing/Invalid Arguement Get Terms
- My title is showing after the shortcode
- Load a Header in wordpress
- Trouble figuring out how to get my button to submit comment
- Setting WooCommerce currency programmatically
- Adding multiple conditional tags in a function?
- How do I change the Go To Categories link in the term_updated_messages
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- Dynamic Email Handler with ‘header (“Location: …’
- WooCommerce: write featured image dimensions to custom fields in product’
- Generate and upload screenshot as featured image for user-submitted post
- a problem in class in class-wp-hook.php
- transition_post_status hook, works – but not if the post is new
- change title of page dynamically
- Custom plugin doesn’t show in admin menu – when code added, displays an empty page