Support » Developing with WordPress » Changing Alt Values of wp_get_archives

  • Resolved brockangelo


    I am playing around with wp_get_archives and would like to know if it is possible to change the “alt” value of the month link.

    Codex says that we can set show_post_count to true. What I would like to do is hover over the link for, say March 2007, and see an alt that says something like “Humor has 17 posts”.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    The links it create should not have “alt” attributes. They might have “title” attributes…

    There is no easy way to change the text it produces for those though. There are no filters and such there. So you’d have to edit the core code. The wp_get_archives() function is in general-template.php. Look for where each type of archive sets the $text variable. That’s the text that it will produce in the title attribute.

    Great – thanks for that info.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Changing Alt Values of wp_get_archives’ is closed to new replies.