Using str_replace on the_content and the_excerpt, but not working on archive index pages

Using str_replace on the_content and the_excerpt, but not working on archive index pages