WordPress.org

Ready to get started?Download WordPress

Forums

Cat + Tag Filter
[resolved] Filter Results Sorted by Title Alphabetically (2 posts)

  1. doomwaxer
    Member
    Posted 1 year ago #

    Is it possible to have filter search results sorted by title alphabetically? Currently, it appears to be sorted in order of post creation.

    http://50.63.47.239/financelibrary/wordpress/

    http://wordpress.org/extend/plugins/cat-tag-filter-widget/

  2. doomwaxer
    Member
    Posted 1 year ago #

    I was able to find a solution. By replacing my themes's archive.php (Other themes might use category.php) loop function with the code below. Replace 'Category' with the name of the category you would like sorted alphabetically by title.

    <?php
    // we add this, to show all posts in our
    // Glossary sorted alphabetically
    if (is_category('Category'))
    {
         $posts = query_posts($query_string .
    '&orderby=title&order=asc&posts_per_page=-1');
    }
    // here comes The Loop!
    if (have_posts()) : while (have_posts()) : the_post(); ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.