I have this code in my theme.
$vandaag = the_date('M d. Y');
echo ucfirst($vandaag);
The output is still "okt 11. 2012" I have the settings for wordpress in dutch, where apparently it doesn't capitalize the month. Any ideas why this doesn't work and still echos a lowercase month?
EDIT: I am using an English installation of wordpress, but have a plugin installed that changes the name of the month to dutch. This only works for the_date() and not when I use get_the_date(). This is what limited me to using the_date().
$vandaag = the_date('M d. Y', '', '', FALSE);
echo ucfirst($vandaag);
It will otherwise echo the value, setting the 4th argument to false will return instead.
Both get_the_date() and the_date() are correct depending on what you are wanting to do. Your preference really. Check out the documentation for both to decide what better fits your current usage.
Because you have to use get_the_date()
.