Last active
August 4, 2020 21:28
-
-
Save KustomDeveloper/36f52cb277716e5cf607a4994d03f843 to your computer and use it in GitHub Desktop.
Shortcode for image cta's
This file contains hidden or 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
| /* | |
| * Shortcode for image cta | |
| */ | |
| function cta_one( $atts ) { | |
| $a = shortcode_atts( array( | |
| 'max_width' => '800px' | |
| ), $atts ); | |
| $img_src = get_template_directory_uri() . "/images/free-food-calc-wide.gif"; | |
| return "<img src=" . $img_src . " style=" . "max-width:{$a['max_width']}" . ">"; | |
| } | |
| add_shortcode( 'cta_one', 'cta_one' ); | |
| function cta_two( $atts ) { | |
| $a = shortcode_atts( array( | |
| 'max_width' => '800px' | |
| ), $atts ); | |
| $img_src = get_template_directory_uri() . "/images/free-food-calc-tall.gif"; | |
| return "<img src=" . $img_src . " style=" . "max-width:{$a['max_width']}" . ">"; | |
| } | |
| add_shortcode( 'cta_two', 'cta_two' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment