Support » Fixing WordPress » Create a new query and pass it on the fly

  • I’d like to know if it’s possible to create a new query “on the fly” and pass it to a new page template.

    For example, I’ve a template called “single.php”, which is for every “Restaurant” page.

    If a user clicks on Category->Sea Food (catid=5), a query query_posts(cat=5)
    is sent to the header as a global variable, so fine so far.

    However, once I’m into Category Sea Food, I want to sort the restaurants in any order -> latest, best rated, etc …

    Can I send a custom query to my template single.php when a user clicks on a link like Category->Sea Food -> Best Rated where “Best Rated” query would be a custom built SQL query ?

    Thanks ! Alex


  • The topic ‘Create a new query and pass it on the fly’ is closed to new replies.