Skip to content

Instantly share code, notes, and snippets.

@MarceloGlez
Created November 28, 2022 22:51
Show Gist options
  • Save MarceloGlez/af25599a6b0d342062c22fc4db7670ed to your computer and use it in GitHub Desktop.
Save MarceloGlez/af25599a6b0d342062c22fc4db7670ed to your computer and use it in GitHub Desktop.
Crea un shortcode en Wordpress para mostrar el año en curso
/*Crea un shortcode para mostrar el año en curso en cualquier lugar de la web en Wordpress, usar luego [year]*/
function current_year_shortcode() {
$year = date('Y');
return $year;
}
add_shortcode('year', 'current_year_shortcode');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment