WordPress.org

Forums

Dynamic post sorting (3 posts)

  1. LiZharD
    Member
    Posted 9 years ago #

    I'm using Custom Query String plugin and it's amazing.. But i would that users can sort posts in category.php template dynamically (eg sort by date ASC or sort by title DESC)..
    Any ideas?

  2. thesheep
    Member
    Posted 9 years ago #

    I am also looking to use a similar feature. I guess the link to 'sort' would need to produce a new database query, and just tell MySQL to sort the results by a different criteria. So I'm thinking it might be necessary to add another variable to the URL. So we have something like archive.php?cat=1&sort=date
    Then we could read in the desired sort criteria using $_GET() and somehow use it when setting up the WP Loop? Be grateful if anyone with more WP experience has any clearer ideas of how to do this. Thanks.

  3. LiZharD
    Member
    Posted 9 years ago #

    Ajaxed way is better.. changing sort oder with no reload..
    WP guru need

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.