In wordpress, we often use the_title() to display or return the title of one post. In this tutorial, we will introduce you on how to customize this fucntion.
The function is:
<?php the_title( $before, $after, $echo ); ?>
Where $echo = false, it will return the title of one post, true will display it.
To customize this function we shoud use add_filter().
For example: we want to add Free Download at the end of post title. We can do like this in your theme functions.php.
Define a function get customize title, the input parameter is post title.
function myTitle($title){ return $title." Free Download"; }
Add it to add_filter()
add_filter( 'the_title', myTitle);