I finally got my empty post titles replaced and I thought Id share how I did it.
Its probally the worst code in the world, but it works.
1. in my themes functins.php I added:
Code:
function new_excerpt_length($length) {
return 4;
}
add_filter('excerpt_length', 'new_excerpt_length');
function new_excerpt_more($post) {
return '';
}
add_filter('excerpt_more', 'new_excerpt_more'); This gave me a new excerpt length of 4 words.
2. then in index.php or archives.php I added:
Code:
if (get_the_title() != '') {$mytitle = get_the_title();
} else {
$mytitle = get_the_excerpt();
$badtitles = array(',','!','?','"','\'','<br />','<br>','<div>','</div>'); //yea ima idiot
$mytitle = str_replace($badtitles, '' , $mytitle);
$myid = $post->ID;
$mytitle = ucfirst($mytitle);
$wpdb->query("UPDATE wp_posts SET post_title = '$mytitle' WHERE ID = '$myid'" );
} and replaced the post title display:
with
3. Then I changed my posts per page reading setting to 50 posts and viewed the each page of the archives normally.
This totally gave me what I wanted, A four word post title with the first letter capitalized.
Then I removed the hack code so archive.php was normal again.
Cheers