a-z post query using AJAX in Wordpress
I'm looking to create a navigation for posts that queries all posts and returns those starting with a certain letter. I'd like this to be AJAX-based, so as to avoid reloading the page.
The navigation would be a simple < ul > and look like:
[ # ] [ A ] [ B ] [ C ] ... [ Z ]
As one clicks on ea开发者_如何学Pythonch < li >, all posts would be queried, and those whose post_title starts with the < li > 's letter would be returned.
How could a system like this be implemented?
- Use
range('A', 'Z')
to make the list - Run a MySQL query where
SUBSTRING(1, 1) == {escapedChar}
精彩评论