Automatically create title (3 posts)

  1. HorrorUK
    Posted 3 years ago #

    Is it possible to automatically create a title for a post?

    I want to have the user not worry about the title, it will just automatically add the user's username as the title.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    Try adding something like:

    function my_autogenerate_title( $title ) {
    	if ( !$title ) $title = get_the_author();
    	return $title;
    add_filter( 'the_title', 'my_autogenerate_title' );

    to your theme's functions.php file.

    WARNING: Not tested.

  3. HorrorUK
    Posted 3 years ago #

    Thanks, that was quick.

    I'll give it a go and see what happens.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.