• Hi,
    Is there a way to show the posts in a certain tag (of if need be all tags) on the tag page (where you click to see the posts in the tag) in reverse chronological order? (so oldest first).

    Trying to get all posts on this tag page https://www.mrhandley.co.uk/tags/dreams-and-dresses/ to display like this- this is a class website with children’s work on, and some are starting to write multi-part stories, which would read better in revese chrono order, but I can’t reverse the order of all posts on the blog as this would mess up other elements.

    Thanks in advance,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Have you reviewed tag templates?

    Thread Starter timhand

    (@timhand)

    Thanks, trying to get my head around that now.
    What php would I need to add into the file to reverse the order?

    Try adding:

    function reverse_tag_listings( $query ) {
        if ( $query->is_tag() && $query->is_main_query() ) {
            $query->set( 'order', 'ASC' );
        }
    }
    add_action( 'pre_get_posts', 'reverse_tag_listings' );

    to your child theme‘s functions.php file.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Reverse order of a tag archrive’ is closed to new replies.