Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #339477

    I’m wondering if there are shortcodes built in for dates such as [the-year] and [the-month] etc.

    Please let me know, and if not, my alternatives.

    #339488

    Hey dmoravec!

    Please add following code to Functions.php file in Appearance > Editor for year

    function year_shortcode() {
    	$year = date('Y');
    	return $year;
    }
    add_shortcode('year', 'year_shortcode');

    and for month

    function month_shortcode() {
    	$month = date('M');
    	return $month;
    }
    add_shortcode('month', 'month_shortcode');

    Best regards,
    Yigit

    #413324

    Does this need to be done every time that I do a theme update? Is there a method that would surpass having to redo this every time I update the theme?

    #413512

    Hey!

    Thank you for coming back.

    When you are using a child theme, put the code in functions.php of the child theme. This file is not changed when updating the parent theme.

    When using a only the parent theme, then you can only use a workaround.

    Put the code in a seperate php file, lets say my_file.php and copy this in the folder enfold\config-templatebuilder\avia-shortcodes\.
    It will then be loaded automatically with the ALB files.

    Just make sure, that you copy this file after every theme update.

    Regards,
    Günter

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.