• Hello,

    I try to make a archive who looks like this : https://floatleft.com/notebook/wordpress-year-month-archives/

    So I have this idea :

    <?php
    /** Load the Core Files */
    require_once( trailingslashit( get_template_directory() ) . 'lib/init.php' );
    new Contango();
    
    add_filter( 'getarchives_where', 'customarchives_where' );
    add_filter( 'getarchives_join', 'customarchives_join' );
    
    function customarchives_join( $x ) {
    
        global $wpdb;
    
        articles =  " INNER JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) INNER JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)";
      for each article
            month = <?php the_time('M')
            year = <<?php the_time('Y')
            prev_year = 0
            <ul>
               $year
            while prev_year is not equal to year
                  <li>
                      <a href="<?php echo get_month_link( $year,$month ); ?>"> <?php the_time('F Y'); ?>
    </a>
               prev_year = $year
                   </li>
            endwhile
             </ul>
        endforeach
    
    }

    Can this idea work or is there a better way to make this work with wp-archive_get function ?

    Roelof

  • The topic ‘Can this be workable ?’ is closed to new replies.