Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #867994

    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);
    
    #868780

    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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.