Skip to content

Instantly share code, notes, and snippets.

@lswilson
Created June 26, 2013 20:43
Show Gist options
  • Select an option

  • Save lswilson/5871469 to your computer and use it in GitHub Desktop.

Select an option

Save lswilson/5871469 to your computer and use it in GitHub Desktop.
Pullquote shortcode
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