I am still pinned against wordpress it appears. I added the widget 'Archives' to my sidebar and when more, the html output is garbage, it essentially has this structure:

<li><a href="somelink">text</a> - (# of posts)</li>

I wish to change it into:

<li><a href="somelink">text <small># of posts</small></a>

In contrast to plug ins however, I wasn't capable of finding the road that produces the html output within the php pages recommended/pointed out through the wordpress community, namely functions.php, icons.php and default-icons.php

I have researched every possible keyword combination around the matter and that i was not able to locate something relevant.

All assistance is appreciated



Take a look at general-template.php. Two functions wordpress_get_archives and obtain_archives_link. You'd need to hack wordpress_get_archives to alter what will get loaded in $text. The publish count will get loaded in to the $after variable which placed outdoors the hyperlink in get_archives_link. Rather than this:

$text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year);
if ( $show_post_count )
   $after = '&nbsp;('.$arcresult->posts.')' . $afterafter;

something similar to this:

$text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year);
if ( $show_post_count )
   $text= $text.'&nbsp;<small>'.$arcresult->posts.'</small>';

That's only for the Monthly archive. You'd need to make modifications around the Yearly, Weekly and Daily blocks.

Edit: Simplest method to exclude the <small> element in the link's title would be to load up inside a separate variable in every block after which pass it right into a modified get_archives_link. Within the example above, immediately after $text will get loaded up just load that value into $title:

$text = sprintf(__('%1$s %2$d'), $wp_locale->get_month($arcresult->month), $arcresult->year);
$title = $text;
if ( $show_post_count )
   $text= $text.'&nbsp;<small>'.$arcresult->posts.'</small>';
$output .= get_archives_link($url, $text, $format, $before, $after, $title);

Then modify get_archives_link:

function get_archives_link($url, $text, $format = 'html', $before = '', $after = '', $title = '') {
    $text = wptexturize($text);

    if($title == '')
        $title = $text;

    $title_text = esc_attr($title);
    $url = esc_url($url);

    if ('link' == $format)
        $link_html = "\t<link rel='archives' title='$title_text' href='$url' />\n";
    elseif ('option' == $format)
        $link_html = "\t<option value='$url'>$before $text $after</option>\n";
    elseif ('html' == $format)
        $link_html = "\t<li>$before<a href='$url' title='$title_text'>$text</a>$after</li>\n";
    else // custom
        $link_html = "\t$before<a href='$url' title='$title_text'>$text</a>$after\n";

    $link_html = apply_filters( "get_archives_link", $link_html );

    return $link_html;