Skip to content

Instantly share code, notes, and snippets.

@musamamasood
Created August 26, 2016 11:34
Show Gist options
  • Save musamamasood/6feadfa0045b7f6f34ba3e0791238916 to your computer and use it in GitHub Desktop.
Save musamamasood/6feadfa0045b7f6f34ba3e0791238916 to your computer and use it in GitHub Desktop.
Using HTML in a Shortcode
// Add Shortcode
function nebco_bannerboxes() {
/* Turn on buffering */
ob_start(); ?>
<div class="box first-box hvr-top hvr-underline-from-center">
<hr class="vertical">
<h4>THE NEBCO</h4><h4>STORY</h4>
<a href="#">
<p class="et_pb_button butt custum-butt">READ MORE</p>
</a>
</div>
<div class="box second-box hvr-top hvr-underline-from-center">
<hr class="vertical">
<a href="#">
<h4>COMMERCIAL RISK</h4>
<h4>MANAGEMENT</h4>
<p class="et_pb_button butt custum-butt">READ MORE</p>
</a>
</div>
<div class="box third-box hvr-top hvr-underline-from-center">
<hr class="vertical">
<hr class="vertical-right">
<a href="#">
<h4>PERSONNEL RISK</h4>
<h4>MANAGEMENT</h4>
<p class="et_pb_button butt custum-butt">READ MORE</p>
</a>
</div>
<?php
/* Get the buffered content into a var */
$content = ob_get_contents();
/* Clean buffer */
ob_end_clean();
/* Return the content as usual */
return $content;
}
add_shortcode( 'bannerboxes', 'nebco_bannerboxes' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment