Querying posts based on index in a page
-
I am building a page where it is displaying A-Z index
https://www.orkidz.co.in/rhymes
While clicking on link A, it should display rhymes that starts with A in specific category. I tried below query but it does not work for me.
query_posts(array('category_name' => 'xyz', 'orderby' => 'title', 'order' => 'ASC', 'title' => <strong>$index . '%'</strong>))
https://www.orkidz.co.in/rhymes/?index=a must display rhymes starts with A
https://www.orkidz.co.in/rhymes/?index=b must display rhymes starts with BRight now it is retrieving posts properly but i have used if statement to filter out. But i don’t like that if statement because it is looping through complete A – Z to filter out title that starts with A.
Anybody can help me out for better solution?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Querying posts based on index in a page’ is closed to new replies.