How to add hook to the_title() and get_the_title()

I’ve having trouble with accented characters now if i do utf8_decode() before echoing the title the problem is solved but instead of changing this all over my theme, can’t I do this in one place that upgrade proof? I’m not really familiar with hooks but I think thats they way to do it, havent found out how to do it tho.

1 Answer
1

The filter for the_title functions is this one:

add_filter( 'the_title', 'f711_title_filter' );

function f711_title_filter( $title ) {

    return utf8_decode( $title );

}

Leave a Comment