Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
add_shortcode( 'spr_services_box', 'spr_services_box_callback' );
function spr_services_box_callback( $atts ) {
$html = "";
ob_start();
$txt1 = "Lorem ipsum dolor sit amet, error feugait consectetuer nec ex, te pro scripta adipisci.";
spr_service_box_content( 'gear', 'Theme Development', $txt1 );
spr_service_box_content( 'wordpress', 'Custom Wordpress', $txt1 );
spr_service_box_content( 'shopping-cart', 'e-Commerce', $txt1 );
spr_service_box_content( 'rocket', 'Plugin Integration', $txt1 );
$html = ob_get_contents();
ob_end_clean();
return $html;
}
function spr_service_box_content( $icon, $title, $content ) { ?>
<div class="grid-25 mobile-grid-100 tablet-grid-50 service-box">
<i class="fa fa-<?php echo $icon; ?>" style="font-size:60px;"></i>
<h3><?php echo $title ?></h3>
<p><?php echo $content ?></p>
</div>
<?php
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment