Created
June 26, 2013 20:43
-
-
Save lswilson/5871469 to your computer and use it in GitHub Desktop.
Pullquote shortcode
This file contains hidden or 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
| function pullquote( $atts, $content = null ) { | |
| extract(shortcode_atts(array( | |
| 'float' => '$align', | |
| ), $atts)); | |
| return '<blockquote class="pullquote ' . $float . '">' . $content . '</blockquote>'; | |
| } | |
| add_shortcode('pull', 'pullquote') | |
| // You can now use the shortcode [pull]your quote here[/pull] in the editor when writing entries. | |
| // Do not forget to style the new code in your theme’s CSS. In this example the shortcode [pull] | |
| // returns <blockquote class="pullquote">. | |
| blockquote.pullquote { width: 220px; padding: 5px 0; border: 0; font-size: 18px; line-height: 150%; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment