Skip to content

eli5wp

  • code snippets

shortcodes

// [current_year] auto update year anywhere shortcodes can be used

September 4, 2025 by emily sparkle
// [current_year] auto updates for footer
function current_year_shortcode() {
    // Get the current year
    $current_year = date('Y');

    // Return the year inside a span
    return '<span class="current-year">' . $current_year . '</span>';
}
add_shortcode('current_year', 'current_year_shortcode');
Categories code snippets, shortcodes

categories

  • code snippets (62)
    • admin (8)
    • child theme (1)
    • css (9)
    • elementor (2)
    • generatepress (11)
    • htaccess (4)
    • shortcodes (1)
    • woocommerce (18)
    • wordpress (15)
    • wp cli (1)
  • links (4)

topics

admin email buttered_toast cache chrome only comments exclude flip card font awesome google analytics google fonts hacky js optimization posts reset responsive shortcode text wp-show-posts

recent

  • // [current_year] auto update year anywhere shortcodes can be used
  • masonry for wordpress gallery
  • elementor flip card for masonry
  • gp control footer widths
  • woo add to cart – display price in button with text according to category
© 2025 ❈ website by fontaholic.biz ❈ maintained by wpbabysitter.com