Title: Slider query change
Last modified: August 31, 2016

---

# Slider query change

 *  [ukchi3f](https://wordpress.org/support/users/ukchi3f/)
 * (@ukchi3f)
 * [10 years, 1 month ago](https://wordpress.org/support/topic/slider-query-change/)
 * Hi all
 * How would i change this code to display certain categories rather than special
   selected posts?
 *     ```
       //Slider 1 query
   
        $querydetails = "
        SELECT wposts.*
        FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
        WHERE wposts.ID = wpostmeta.post_id
        AND wpostmeta.meta_key = 'pm_featured_post_1'
        AND wpostmeta.meta_value = '1'
        AND wposts.post_status = 'publish'
        AND wposts.post_type IN ('post', 'page')
        ORDER BY wposts.post_date DESC
        ";
       ```
   
 * I thought it would be using this:
    $query = new WP_Query( array( ‘category_name’
   => ‘xbox’ ) );
 * but not sure
    Apologies if i have posted in the wrong place.
 * Any help offered would be greatly appreciated

The topic ‘Slider query change’ is closed to new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [ukchi3f](https://wordpress.org/support/users/ukchi3f/)
 * Last activity: [10 years, 1 month ago](https://wordpress.org/support/topic/slider-query-change/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
