Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@w33zy
Created January 14, 2020 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save w33zy/21e99b8fc1110a702adadfdae8746e64 to your computer and use it in GitHub Desktop.
Save w33zy/21e99b8fc1110a702adadfdae8746e64 to your computer and use it in GitHub Desktop.
shortcode
<?php
function callout_shortcode( $atts ) {
$out = '';
$atts = shortcode_atts(
array(
'callout_h4' => 'This is a header',
'callout_p' => 'This is the paragraph below it',
),
$atts
);
$out .= '<div class="callout">';
$out .= '<h4>' . esc_html( $atts['callout_h4'] ) . '</h4>';
$out .= '<p>' . esc_html( $atts['callout_p'] ) . '</p>';
$out .= '</div>';
return $out;
}
add_shortcode( 'callout', 'callout_shortcode' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment