I’d like to find an optimized, WP_Query-safe method for generating a dynamically-populated copyright statement for the bottom of my themes. That is to say, I’d like to check the date (by year) of my oldest and newest posts and then output something along the lines of
[blog name] © [oldest post year]-[newest post year] [primary blog author]
What’s the easiest/safest way to do so?
Here’s what I use:
Of course, if there’s a cleaner, safer, or more efficient method, I’d love to hear about it, too!
EDIT:
And here’s a more cleaned-up version, that adds the copyright dates to wp_cache:
Would this improve performance a bit?