Virtually all WordPress themes will style their blockquotes in a specific manner - not always to your liking. While it's super-simple to write some custom CSS and overwrite the default behaviour, our shortcode will permit you to preserve the theme-specific style and use another for basic text. The function supports nested shortcodes, meaning that you can use shortcodes inside the blockquote. The code isn't completely unlike our textbox shortcodes... apart from the fancy-pants formatting.
Again, using CSS is almost always a better means of formatting your page. There are times, however, where this might be useful.
The Result
In its most simplest form, a shortcode of [blockquote]Your content in here...[/blockquote]
will generate the following. For the sake of the example we'll include a random quote (generated with shortcode of [qotz]
).
The Code
Copy and paste the WordPress function into your theme's functions.php
file or, if you sensibly have one installed, your custom functions plugin. You may optionally download and install our plugin from the bottom of of the page.
If you require shortcode to work in a sidebar widget, you'll have to enable the functionality with a filter. If you're using our custom functions plugin, you'll have that feature enabled by default.
Shortcode Attributes
Following attributes alter the blockquote presentation.
width
width
of the blockquote. Can be a percentage or pixel width. If none provided, defaults to pixels.maxwidth
maxwidth
(90% seems to be okay)padding
Considerations
- The blockquote supports nested shortcode and paragraphs.
- See also: Text Boxes With WordPress Shortcode.
Download
Title: Blockquotes in WordPress (WP Plugin)
Description: Renders a blockquote in WordPress with shortcode.
Download • Version 0.2, 1.4K, zip, Category: WordPress Plugins (General)
WordPress Shortcodes, (612.0B)