Title: Adding theme option to query_posts
Last modified: August 19, 2016

---

# Adding theme option to query_posts

 *  [r2o4l7l](https://wordpress.org/support/users/r2o4l7l/)
 * (@r2o4l7l)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/adding-theme-option-to-query_posts/)
 * Hello,
    I would like to implement one of my entries from my theme options page
   into the post query.
 * This is the original post query:
    `<?php query_posts('showposts=10&amp;cat='-
   4,-6'');`
 * However, I have entered the -4,-6 into the theme options page (for templating
   reasons) and would like to call that into the query like this:
    `<?php query_posts('
   showposts=10&amp;cat='<?php echo $bluelight->option["exclude_categories"] ?>'');`
 * Doesn’t seem to be working. I probably just have the PHP markup wrong but I just
   can’t get it to function.
 * Any help appreciated!
    Mike

The topic ‘Adding theme option to query_posts’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [r2o4l7l](https://wordpress.org/support/users/r2o4l7l/)
 * Last activity: [17 years, 1 month ago](https://wordpress.org/support/topic/adding-theme-option-to-query_posts/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
