Title: not equal operator
Last modified: August 19, 2016

---

# not equal operator

 *  Resolved [kumaraw](https://wordpress.org/support/users/kumaraw/)
 * (@kumaraw)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/not-equal-operator/)
 * i want to show all post in all category expect a category name “design”.
    i use
   this but didn’t work <?php query_posts(“category_name!=slider”); ?>

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/not-equal-operator/#post-1654793)
 * `<?php query_posts('category_name=-slider'); ?>`
 * Now, the minus sign works in front of cat ID, not sure about name?
    [http://codex.wordpress.org/Function_Reference/query_posts#Category_Parameters](http://codex.wordpress.org/Function_Reference/query_posts#Category_Parameters)
 *  Thread Starter [kumaraw](https://wordpress.org/support/users/kumaraw/)
 * (@kumaraw)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/not-equal-operator/#post-1654795)
 * its didn’t work with category name
 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/not-equal-operator/#post-1654798)
 * well, if you find out the category ID, I know this works
 * `query_posts('cat=-3');`
 *  Thread Starter [kumaraw](https://wordpress.org/support/users/kumaraw/)
 * (@kumaraw)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/not-equal-operator/#post-1654802)
 * its work, but i need it by category name, any solution?
 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/not-equal-operator/#post-1654803)
 *     ```
       <?php $id = get_cat_id('design');
        query_posts("cat=-" . $id, '&paged=' . get_query_var('paged')); ?>
       ```
   
 * not sure if I have this exactly right, but get the ID for the cat, then exclude
   it
 *  Thread Starter [kumaraw](https://wordpress.org/support/users/kumaraw/)
 * (@kumaraw)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/not-equal-operator/#post-1654805)
 * thanks dud! its work fine!
    **Thanks**
 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/not-equal-operator/#post-1654808)
 * Sure thing, glad it worked for you! Mark the thread as resolved using the dropdown
   on the right if you are happy with the help please

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘not equal operator’ is closed to new replies.

## Tags

 * [operator](https://wordpress.org/support/topic-tag/operator/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 2 participants
 * Last reply from: [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/not-equal-operator/#post-1654808)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
