Monkeyboy
Member
Posted 3 years ago #
Is there a way to display posts by alphabet? I understand it's possible to order posts by name, either ascending or descending, but suppose I just want to display posts from a certain category, but only those beginning with the letter A, or letter B and so on. Is it possible?
If you are just want to get a sub-set of posts in category 4, where the title begins with A or B then this might work (didn't test this):
<?php
function filter_where($where = '') {
$where .= " AND post_title >= 'A' AND post_title < 'C'";
return $where;
}
add_filter('posts_where', 'filter_where');
query_posts($query_string . '&cat=4');
?>
Hi,
Yes, it is possible to display post in alphabetically but for that you have to modify the code inside the index.php file of your blog theme folder..
[spam link removed]
Thanks,
Shane G.