Customizing WordPress Search Results to Sort by Title - Designing a Complex Application (
Page 5 of 5 )
As said earlier, this functionality can be used to create complex applications in WordPress. For example, say you need to create a music site that will enable users to rate a song from 1 to 5. There are also other users that might be looking for great songs in your catalog.
The following are example title tags (dynamically generated as the average song rating) of the song post. Assume all of them use “rock-music” as the custom fields in the post (combine with http://wordpress.org/extend/plugins/search-everything/ , so that WordPress will look at custom field data as a basis for the search).
Song rating 4.5 “ Song title 1”
Song rating 3.2 “ Song title 2”
Song rating 4.9 “Song title 3”
If a user types into the search box the phrase “rock music,” WordPress will then return the search results in the descending order of song ratings, so that listeners will be able to listen the best songs first:
Song rating 4.9 “Song title 3”
Song rating 4.5 “ Song title 1”
Song rating 3.2 “ Song title 2”