First you should move wp_reset_query();
outside of the loop instead of resetting the query every post of the loop.
And as for your query you can use category__not_in
$args = array(
'cat' => 14,
'category__not_in' => array('45'),
'posts_per_page' => 20
);
$the_query = new WP_Query($args);
while ($the_query->have_posts()) : $the_query->the_post();?>
<li>
<a href="https://wordpress.stackexchange.com/questions/17387/<?php the_permalink() ?>" rel="bookmark" class="postTitleLink">
<?php the_title(); ?></a>
</li>
<?php endwhile; ?>
<?php wp_reset_query(); ?>
this will exclude all posts of category 45.
Related Posts:
- Get posts from sites in Multisite?
- How To Modify The Loop in archives.php To Have 11 Posts Per Page and CSS Styling
- Using categories & “stickyness” together
- Does the ‘cat’ argument in query_posts fetch posts from subcategories as well as the given ID?
- List posts by category exclude current post
- Display only the latest post from multiple categories
- Select category in custom query
- Display one latest post from multiple categories
- Return category slug / title from category ID
- Exclude category from loop not working
- “NOT ONLY IN” taxonomy query operator?
- functions.php conditional tag – only show in single.php?
- Post count for category and tag
- Checking for two categories in query_posts
- How to query post like normal search would do. within search.php page
- Query Posts Exclude Entire Category
- how to query posts and auto assign category if post title has keyword
- How do I call posts with a certain tag?
- Modify WordPress SQL Query to pull from within a category
- query order by category
- Get link which associated with a specific category and tag
- How do I toggle pagination on/off in search results and category listings via a link?
- Order by category titles
- Have parent category contain only one post?
- List posts in alphabetical order
- How to conditionally hide author name on Single.php if category is “news”, otherwise if category is something else display author name?
- Conditional IF current cat is the smallest/last/end child cat THEN
- Randomly load categories with latest post
- Set colors depending on category
- How do I query_posts in cat=1 AND not in cat=2
- List all posts in a category with query_post() function
- How do I display something on a particular category page?
- query_post order desc
- Show the latest post from child category?
- Pagination on category.php and tag.php not working
- Problem with different query loops (and “main loop”) on category template page!
- query_posts not reading correct categories
- Problems with my conditionals in single.php by category
- Pagination for query_posts();
- Posts from a category on homepage with category archieves page default css
- function query_posts disabling current_page_menu class
- Home Page Template – Specific Category
- query_posts by category_name and custom taxonomy
- wordpress taxonomy query posts
- PHP dynamical conditional post display
- Posts of specific category on page and excluded from index.htm
- new WP_Query issues
- how can i hide category?
- Displaying links to all posts of the same category on the post page
- Post not found when filtered by category ID
- Exclude categories from postquery
- Sort posts alphabetically by category/custom taxonomy, insert divider between different types
- Show posts from category specified using a custom field
- query_post problem
- Add class to current post in query_post
- Different post slug based on archive
- Pagination does not work with query_posts()
- Assign a class to first element in category in loop
- How to display products with multiple conditions, product_id and category_id
- Conditional statement: if is_category, append at the end of page
- Query post only from categories that have subcategories
- Conditional statements based on custom meta value in category archives
- Displaying posts by year
- Paginate WordPress Category Pages
- How to have a category not show up in query post with page panigation?
- Query pages by category
- Showing one post from each category, paged?
- Weird html output of single_cat_title – is not inside of the html element?
- get_categories for custom post type with a specific custom taxonomy attached
- Exclude categories from Loop, queries, widgets, post navigation
- WordPress 1 domain multiple blogs
- One WordPress Install, Two Categories. Each Category Gets a Domain
- Name of last category level for a post
- How to add style to category link?
- WordPress Ordering Problem. How to fix ordering 1-10-100 issue?
- Filtering search results
- WooCommerce change category url and product base
- How can we get Catergory / Term Creator
- Seperate WordPress catagories into sepeat list on seperate pages
- Redirect category to first available child post
- Display WordPress Parent Categories Only?
- Assign automatically and manually modify category
- list categories based on updated posts [closed]
- How can I only display one link rather than many?
- Hierarchical permalink structure for posts showing categories and sub-categories
- how i can hide some category from author admin panel?
- Echo show_count of categories separately without using wp_list_categories
- Let user select their own category
- Pagination breaks on child-categories, works fine on parent-category
- Category name for all posts getting assigned to a single random post
- How to add the .html extension to the category?
- How to create category filter on a blog like on the site below?
- How to Manage and link certain custom taxonomy?
- Store All Post Categories In Array
- How to add an “All” category to the tag cloud?
- Categories Going to different Blog Pages?
- Template files not working for archives and categories
- Multiple Parent Category URLs
- What defines a post as portfolio page content?
- Taxonomy term RestApi data 10 rows limitions