---
description: >-
  https://stackoverflow.com/questions/25761593/wp-query-with-post-title-like-something-and-category
---

# WP\_Query with title (ok)

```
query_posts( array(
    'post_type' => 'add_buying',
    's' => $keywords,
    'posts_per_page' => 5,
    'taxonomy' => 'add_country',
    'term' => 'drawing' 
));
```

```
$args = array(      
    'post_type'   => 'post',
    's'           => $search_term,
    'post_status' => 'publish'    
);
$wp_query = new WP_Query($args);
```

```
$args = array(      
    'post_type'   => 'post',
    'title'       => $title,
    'post_status' => 'publish'
); 
$wp_query = new WP_Query($args);
```
