Skip to content

Instantly share code, notes, and snippets.

@BeardedGinger
Created June 9, 2016 18:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BeardedGinger/9f8cd674f6cdfe74d66c08d17c8cb95b to your computer and use it in GitHub Desktop.
Save BeardedGinger/9f8cd674f6cdfe74d66c08d17c8cb95b to your computer and use it in GitHub Desktop.
<?php
function shortcode_build( $atts, $content = null ) {
extract( shortcode_atts( array(
'background_color' => '',
'image' => '',
'image_position' => ''
),
$atts, 'limecuda_banner' ) );
ob_start();
?>
<section class="limecuda-banner limecuda-case-study-component <?php echo esc_attr( $background_color ); ?>">
<div class="wrap">
<?php
$content_class = 'center';
if( $image ) {
$content_class = ''; ?>
<div class="banner-image <?php echo esc_attr( $image_position ); ?>">
<?php echo wp_get_attachment_image( $image, 'full' ); ?>
</div>
<?php
} ?>
<div class="banner-content <?php echo esc_attr( $content_class ); ?>">
<?php echo do_shortcode( $content ); ?>
</div>
</div>
</section>
<?php
return ob_get_clean();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment