Support » Plugins » Hacks » change tag.php to show year-wise posts

  • Hi

    In the codex i found:
    <select name=”archive-dropdown” onchange=”document.location.href=this.options[this.selectedIndex].value;”>
    <option value=””><?php echo esc_attr( __( ‘Select Year’ ) ); ?></option>
    <?php wp_get_archives( array( ‘type’ => ‘yearly’, ‘format’ => ‘option’, ‘show_post_count’ => 1 ) ); ?>

    Which lists posts by the year.
    What do i need to change in this to make it applicable only to the selected tag page?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz


    wp_get_archives() cannot filter by tag terms as it stands. If you know mySQL and how to query by tag terms, you can hook the ‘getarchives_where’ and ‘getarchives_join’ filters to alter the the function’s query to limit it to the desired tag terms.

Viewing 1 replies (of 1 total)
  • The topic ‘change tag.php to show year-wise posts’ is closed to new replies.