how can i use the_tile in function.php
//
function insert_image_before_title($title) {
if( !current_user_can( 'contributor' ) && in_the_loop() ) {
$title = 'contributor ' . $title;
}
return $title;
}
add_filter( 'the_title', 'insert_image_before_title', 10, 1);
Hey chocomuscake,
Thank you for using our theme.
The code above can be put in functions.php of the child theme (when using a child theme) or the parent theme at the end of the file.
For testing purpose remove the if statement and only return the changed title. This worked for me.
Then check, if the if statement will return true, otherwise you will get the unmodified title.
Best regards,
Günter