add_filter ('widget_text', 'do_shortcode'); function display_year() { $year = date('Y'); return $year; } add_shortcode('year', 'display_year');