Support » Fixing WordPress » How do I set a default post title?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You can use code similar to that shown in the article you linked to, only use default_title instead of default_content. You might want to incorporate the date and time into the title so each post would have a unique title. Otherwise finding a post will be quite difficult.

    Thread Starter andrewcmyk

    (@andrewcmyk)

    Aha! Thank you, that did the trick.

    hello.

    i am trying to add a default title to my posts.
    i tried to follow the instructions above but am struggling to get it to work!

    basically at the moment my post titles (as i do not enter post titles) automatically default to the date of the post. i like this but also want to add a bit of default text in there as well, so that its not simply the timestamp but rather “MYTEXT: timestamp”.

    following advice above, i tried adding this to the end of my functions.php:

    <?php
    
    add_filter( 'default_title', 'my_editor_title' );
    
    function my_editor_title( $title ) {
    
    	$title = "MYTEXT";
    
    	return $title;
    }
    
    ?>

    but it doesn’t work.

    any ideas what i am doing wrong?
    any help would be much appreciated?

    many thanks,

    adam.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I set a default post title?’ is closed to new replies.