This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Basic shortcode to return the current year (for copyright line) | |
Example: © [year] itsViney | |
*/ | |
function currentYear($atts) | |
{ | |
return date('Y'); | |
} | |
add_shortcode('year', 'currentYear'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Enhanced ACF link shortcode. Return format must be array for this to work | |
Element can be url, title or target | |
Example: [acf_link field="my_link_field" post_id="1000" element="url"] (returns the URL of the link) | |
Example: [acf_link field="my_link_field" post_id="1000" element="title"] (returns the title of the link) | |
*/ | |
function acf_link_shortcode($atts) | |
{ | |
extract(shortcode_atts(array( | |
'field' => '', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Enhanced ACF date shortcode. Return format must be set to Ymd in ACF for this to work | |
Example: [acf_date field="my_date_field" post_id="1000" date_format="d F Y"] | |
*/ | |
function acf_date_shortcode($atts) | |
{ | |
extract(shortcode_atts(array( | |
'field' => '', | |
'post_id' => false, | |
'format_value' => true, | |
'date_format' => '' |