Disabling sub category posts and alphabetizing posts by title
I’m using WordPress as a CMS, and have a need to alphabetize posts, and at the same time limit the posts to only the parent category (no sub category posts). I’ve been using the following code in my functions.php:
That works fine, but if I try to do something like this so that the posts are alphabetized, then I seem to get every post, even ones that aren’t in the related category in any way:
$posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1');
I got that little bit of code from here:
Anyone know what I’m doing wrong and how to fix it?
- The topic ‘Disabling sub category posts and alphabetizing posts by title’ is closed to new replies.