• Resolved thisisedie

    (@thisisedie)


    Call me slow but I just recently figured out what a themes functions.php is used for so how to use it is still 99.99% a mystery to me. Following directions at a site I Googled up, I customized the way my excerpts look using it. Now I want to customize the way the post count looks on archives (want JUST the count to be small font) and I found where to do that in the general-template in the core files but when I try to implement it in functions.php the same way I did for the excerpts, it doesn’t work. If someone could enlighten me to the proper way to do this I’d be ever so grateful. Here’s the code that doesn’t work:

    remove_filter('wp_get_archives', 'get_archives_link');
    add_filter('wp_get_archives', 'small_post_count');
    
    function small_post_count($url, $text, $format = 'html', $before = '', $after = '') {
    $text = wptexturize($text);
    $title_text = attribute_escape($text);
    $url = clean_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><small>$after</small>\n";
    $link_html = apply_filters( "get_archives_link", $link_html );
    return $link_html;
    }

The topic ‘Functions.php Hates Me’ is closed to new replies.