How To capitalize The First Letter Of Every Word In The Post Title
The code below was assembled of different pieces I’ve found around and it was not tested. Consider it as an idea only. <?php add_filter( ‘the_title’, ‘my_capitalize_title’, 10, 2 ); function my_capitalize_title( $title, $id ) { // get separate words $words = preg_split( ‘/[^\w]*([\s]+[^\w]*|$)/’, $title, NULL, PREG_SPLIT_NO_EMPTY ); $stop_words = array( ‘the’, // ‘a’, ‘and’, ‘of’, … Read more