Editing "The Loop". Need list alphabetical
-
Hi folks,
I have been customizing a category-categoryname.php file, and I am having ‘fun’ with The Loop, trying to get the list of Pages (not Posts) to display alphabetically.I have a feeling that the answer is probably hidden in plain sight, but I’ve working at this late and I just can’t see it.
Note: I am using a plugin to enable Pages to work with Categories:
“Add Categories to Pages.”Here is where I got to before trying to make the list display A-Z.
It all works fine:<?php // The Loop START while ( have_posts('orderby=title&order=ASC') ) : the_post('orderby=title&order=ASC'); ?> <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4> <?php endwhile; else: ?> <p>Sorry, no posts matched your criteria.</p> <?php endif; // The Loop END ?>
… but I am trying to make the list of pages associated within the category list Alphabetically.
I tried adding ‘orderby=title&order=ASC’ inside:
while ( have_posts( here ) ) : the_post( or here );
… but I found that this doesn’t work.I found this thread, where the OP provides some solution at the end, but he didn’t explain where exactly he placed it within The Loop, and the thread is closed.
https://www.ads-software.com/support/topic/sort-posts-alphabetically-or-by-date-depending-on-category?replies=5I tried to use code from this closed thread, but my results just displayed all my Posts and not my Pages under the one Category:
https://www.ads-software.com/support/topic/orderbytitle-not-working?replies=11Any help would be greatly appreciated.
Thanks
- The topic ‘Editing "The Loop". Need list alphabetical’ is closed to new replies.