Alphabetizing Simple Tagging Search Results – Problem with Loop in Template
-
I’m using the Simple Tagging plugin and am trying to alphabetize tag search results: the posts that are displayed when a tag is clicked.
I put the pagetemplate.simpletagging.php file in the root folder of my theme, and in the Simple Tagging settings, used that for the ‘search results template file.’ The template works fine, and I get all the posts for that tag displayed, until I change the loop to this piece of code, which I thought should alphabetize the results:
<?php $posts = query_posts($query_string . '&orderby=title&order=asc&posts_per_page=-1'); if (have_posts()) : while (have_posts()) : the_post(); ?>
When this code is used, no posts are shown for tag results at all, however I do get the “Sorry Not Found” display from my template instead.
But, if I use that same loop code on the Main Index Template (rather than a separate template), I can get alphabetized tag results, but of course I get them on the front page as well. I want the front page to display chronologically, or maybe a ‘front page’ category. (I’m using both categories and tags, but only having problems alphabetizing the tag results.)
It’s not unlikely my problem stems from not understanding something fundamental about the loop or querying posts. I would very much appreciate any help from anyone with more experience and hope someone has an answer or work-around.
blog in question: https://www.vintagevinylrevival.com/records/
Thanks!
- The topic ‘Alphabetizing Simple Tagging Search Results – Problem with Loop in Template’ is closed to new replies.