joli_toc_toc_title

Customizes the TOC title.

add_filter('joli_toc_toc_title', 'my_custom_title', 10, 1);

function my_custom_title( $title ){ 
    if ($a == $b){
        $title = "My Custom TOC Title";
    }else{
        $title = "My Alternate TOC Title";
    }

    return $title;
}

Different Table of Contents title per language using WPML

If you are using the WPML plugin, you can set a TOC title per language using the following snippet :

add_filter('joli_toc_toc_title', 'my_custom_title', 10, 1);

//Different TOC title per language using WPML
function my_custom_title( $title ){ 
    if(ICL_LANGUAGE_CODE=='en'){
     $title = "Contents";
    } elseif(ICL_LANGUAGE_CODE=='fr'){
     $title = "Sommaire";
    }
 
    return $title;
}
Was this page helpful?