Hello,
I wonder how I can count how many months there is where there are posts in?
Example
august 2010
november 2010
Above example should return 2.
Is there any code or function I can use to get this?
Thanks in advantage
Greetings Fredrik
Hello,
I wonder how I can count how many months there is where there are posts in?
Example
august 2010
november 2010
Above example should return 2.
Is there any code or function I can use to get this?
Thanks in advantage
Greetings Fredrik
This should do it:
$list = wp_get_archives(array('type' => 'monthly','echo' => false));
$months = explode('<li>',$list);
array_shift($months); // first entry is empty
echo "<p>Count:" . sizeof($months) . '</p>';That works perfect vtxyzzy!
Thanks a lot!
This topic has been closed to new replies.