Title: A custom search
Last modified: August 19, 2016

---

# A custom search

 *  [fabrizio.u](https://wordpress.org/support/users/fabriziou/)
 * (@fabriziou)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/a-custom-search/)
 * Hi,
    I need to create a custom search to retrieve two posts with specific id 
   passed by a query string. I think I can modify loop-search.php using query posts
   passing parameters “p”. Unfortunately I’m quite confused on some important issues:
    - Can I use sintax **query_posts(‘p=’.$p1.’,’.$p2);** where $p1 and $p2 are 
      passed by query string?
    - Assuming I’m able to parse a query string and fill the above variables, how
      can I pass a custom query string (i.e.: **p1=123&p2=657**) from search template?
    - Since I use custom permalinks, and search url is domain.com/search/query, 
      how can I adapt it and make it work (if possible?)
 * I hope it sounds not too confusing 🙂
 * Fabrizio

The topic ‘A custom search’ is closed to new replies.

 * 0 replies
 * 1 participant
 * Last reply from: [fabrizio.u](https://wordpress.org/support/users/fabriziou/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/a-custom-search/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
