Create a gist now

Instantly share code, notes, and snippets.

<?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