WordPress.org

Forums

Smart Archives Reloaded
Display years with fancy starting from latest year on the left (5 posts)

  1. progressive_
    Member
    Posted 1 year ago #

    Hello!

    I was just wondering how I could display fancy but starting with the latest year to the left?

    This how it looks like right now.

    http://www.camillawestin.se/wp-content/uploads/2014/01/archive.png

    I'd like it to be reversed.

    http://wordpress.org/plugins/smart-archives-reloaded/

  2. nici-
    Member
    Posted 1 year ago #

    Hi!
    Did you found out how to do this?
    Thanks, nici-

  3. progressive_
    Member
    Posted 1 year ago #

    Hi Nici!

    No I did not. I ended up not using the plugin at all =/

  4. nici-
    Member
    Posted 1 year ago #

    Sooooooooooo, ich habe es!

    Du must die Sortierung umstellen in der generator.php

    Hier drehst Du die Reihenfolge der Jahresanzeige so:

    Zeile 45-48

    function query_manipulation( $bits, $wp_query ) {
    if ( $wp_query->get( 'months_with_posts' ) ) {
    $bits['fields'] = 'DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month';
    $bits['orderby'] = 'year ASC, month ASC';
    }

    Hier steht normalerweise year DESC, zum Umdrehen also 'ASC' eingeben. Damit kommt das jüngste Jahr nach vorn/links.

    Damit auch das zugehörige Pane als erstes geladen wird, musst Du dann auch noch die Reihenfolge der Panes umdrehen. Sonst wird eben nach wie vor beim Laden des Archivs die Liste des ältestesten Jahres aktiv angezeigt. Die Panes werden hier sortiert:

    Zeile 119
    foreach ( $this->get_years_with_posts( 'desc' ) as $year )

    Hier steht normalerweise asc, also muss hier nun desc hinein. Und fertig!

    HTH
    Viele Grüße

  5. nici-
    Member
    Posted 1 year ago #

    Ah oh, sorry.

    In English: You alter two lines in the generator.php

    Line 48
    change DESC to ASC

    Line 119
    change asc to desc

    That's it. Have fun!

    nici-

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Smart Archives Reloaded
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic