Skip to content

Instantly share code, notes, and snippets.

@yeriepiscesa
Created April 20, 2019 04:21
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 yeriepiscesa/64e336dc70350813703972a8374ce46a to your computer and use it in GitHub Desktop.
Save yeriepiscesa/64e336dc70350813703972a8374ce46a to your computer and use it in GitHub Desktop.
<?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