Sorted wp_get_archives (2 posts)

  1. prostoalex
    Posted 10 years ago #

    Gentleman, how would you go about sorting the output of wp_get_archives alphabetically?

    I am talking about postbypost type of wp_get_archives and perhaps limit of 100 latest entries.

  2. Kafkaesqui

    Posted 10 years ago #

    I'd rewrite the get_archives function, since the sort column is hardcoded. The function is found around line 260 (1.5) in:


    In the file look for this elseif:

    } elseif ('postbypost' == $type) {

    Change the $arcresults SELECT line at the end from:

    ORDER BY post_date DESC" . $limit);


    ORDER BY post_title ASC" . $limit);

    Practice good hacking by backing up core WordPress files before editing them, and comment your changes.

Topic Closed

This topic has been closed to new replies.

About this Topic