WordPress.org

Ready to get started?Download WordPress

Forums

Using AJAX to reorder comments on the fly? (1 post)

  1. John Peden
    Member
    Posted 1 year ago #

    Hi folks,

    I've found that using:

    add_filter( 'comments_array', 'array_reverse');

    Does exactly what I want in terms of displaying comments from newest-oldest. However, I want to give users the option of doing this on-the-fly. The best I've been able to manage is using a dropdown box to modify an option in the theme but due to the timing of the option being modified vs. the comments being loaded, it requires not one but TWO page refreshes in order to display correctly.

    If I could get the comments to reorder on a single page refresh I'd be happy. If I could get them to reorder using AJAX without refreshing at all I'd be really happy!

    Any suggestions?

Topic Closed

This topic has been closed to new replies.

About this Topic