Last active
September 9, 2016 15:42
-
-
Save jo-flynn/1a2acede780cffd99a1aa8e46de848e6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!empty($title)) { | |
?> | |
<h4> | |
<?php | |
echo $title; | |
?> | |
</h4> | |
<?php | |
} | |
if (!empty($text)) { | |
?> | |
<div class="callout-text"> | |
<?php | |
echo $text; | |
?> | |
</div> | |
<?php | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// usage: [fancy-callout heading="Custom Heading"]Custom Content[/fancy-callout] | |
add_shortcode('fancy-callout', function ($atts, $content = null) { | |
return silencio_partial('fancy-callout', ['heading' => $atts['heading'], 'text' => $content], false); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// .. other single.php logic | |
silencio_partial('fancy-callout', ['heading' => $post->post_title, 'text' => $post->post_excerpt]); | |
// .. other single.php logic |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment