/* shortcode for the current year */
function year_shortcode() {
$year = date('Y');
return $year;
}
add_shortcode('year', 'year_shortcode');
Im just seeing the shortcode instead othe current yearIt looks like you're new here. If you want to get involved, click one of these buttons!
Comments
I have tested your code and it works fine for me.
1. Do you use a child theme and is it the active theme?
2. Can you post a screenshot of where you have added this code?
3. Where do you try to use shortcode? Not every place parses shortcodes.
With kind regards.
This code is in functions - im using your child theme
* Add here your functions below, and overwrite native theme functions
*/
/* shortcode for the current year */
function year_shortcode() {
$year = date('Y');
return $year;
}
add_shortcode('year', 'year_shortcode');
I am trying to use the year shortcode in the bottom footer bar via customize footer
Made with Metta · © [year] Powered by xxx
All I can see is the [year] echoed back
Thanks
Try this :
Go to rife\advance\utilities\footer.php line ~195 and change
$ft = $apollo13framework_a13->get_option( 'footer_text' );
to
$ft = do_shortcode($apollo13framework_a13->get_option( 'footer_text' ) );
Should do the trick.
With kind regards.