Skip to content

Instantly share code, notes, and snippets.

@jamesfosker
Last active July 5, 2021 12:38
Show Gist options
  • Save jamesfosker/6fd1533a2132a03f1f9d55d576560c9c to your computer and use it in GitHub Desktop.
Save jamesfosker/6fd1533a2132a03f1f9d55d576560c9c to your computer and use it in GitHub Desktop.
Company Age shortcake
<?php
function companyage(){
$currentyear = date("Y");
$foundedyear = '1979'; //change year to your own year
$companyage = $currentyear - $foundedyear;
return = $companyage;
}
add_shortcode('mycompanyage', 'companyage');
// use [mycompanyage] to output the business age in years
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment