WordPress.org

Ready to get started?Download WordPress

Forums

Automatically create title (3 posts)

  1. HorrorUK
    Member
    Posted 1 year 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 1 year 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
    Member
    Posted 1 year 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

Tags

No tags yet.