Special Text Boxes is very simple, very little and very useful WordPress plugin (for me and, I hope, for you). It adds little style sheet file and short code to blog for highlighting some portion of text in post as colored boxes. That may be warning, alert, info and download portion of post’s text.
(This post is available on russian language.)
Support Forum for this plugin.
Examples
CSS mode


Javascript mode


Installation
- Unpack plugin archive file.
- Put plugin folder to WordPress
wp-content/pluginsfolder. - Activate plugin on Admin page.
Settings
You can set border style, text shadow, box shadow and Allow or disable rounded corners for your special text boxes.
Available languages of Admin Panel:
- English
- Russian
- Italian by Gianni Diurno
- Belarus by Fat Cower
- Uzbek by Alisher Safarov
- Polish by Daniel Fruzynski
- Arabic by مدونة رسين
- Dutch by Rene
- Ukrainian by official ukrainian localization team
- German by Renate
- Czech by Stanislav Čihák
If you want and can translate this plugin to your language, do it, and send me .po file by e-mail (minimus AT simplelib.com). Thanks.
Styles Repository
Starting with version 4.0.65 plugin allows you to have as many styles as you want. All styles are stored in the styles repository (database table) and can be customized to suit every taste. Styles fall into two categories: predefined (system and special) styles, and custom styles. The parameters of all styles can be changed by blog administrator. The difference is that the slugs (unique names) can be set only for custom styles. Slugs for predefined styles can not be changed.
Use this repository to customize existing and create new styles of blocks.
Usage
To embed special textbox to your post, use short code as this:
OR
[stextbox id="defined_id" caption="Some Caption"]Highlighted text and/or short code(s)[/stextbox]
where defined_id may be alert, download, info, warning, black, custom and gray.
You can insert short code(s) of another plugin(s) inside wp-special-textboxes short code. For example:

Customising “On The Fly”

Customisation Short Code Options:
- color – body font color
- ccolor – caption font color
- bcolor – border color
- bgcolor – background color (CSS mode) or start color of background gradient (Javascript mode)
- bgcolorto - stop color of background gradient (Javascript mode only)
- cbgcolor – caption background color (CSS mode) or start color of caption background gradient (Javascript mode)
- cbgcolorto - stop color of caption background gradient (Javascript mode only)
- image – full URL of pictogram image. Use null value as URL to disable image output
- big – use this parameter in case plugin settings are different with your needs. May be true or false. CSS mode only.
- mode – drawing mode (css|js)
- float – turn on floating mode of Special Text Box. May be true or false.
- align – alignment of box in float mode. May be left or right.
- width – width of box in float mode (pixels)
- collapsed – display STB in collapsed mode if collapse/expand mode enabled. May be true or false.
- mleft – left margin in px.
- mright – right margin in px.
- mtop – top margin in px.
- mbottom – bottom margin in px.
- collapsing – allow/disable collapsing (default|true|false)
- defcaption – allow using name of style as caption of block (true|false)
- direction – language direction (default|ltr|rtl)
You can use Insertion Dialog to insert short code to post. Just select text you needed and click “Insert Special Text Box” button.
Special Text Box anywhere in blog
You can use function stbHighlightText to output Box anywhere in your blog.
This function defined as
|
1 |
function stbHighlightText( $content = null, $id = 'warning', $caption = '', $atts = null ) |
- $content – text in the Box (string)
- $id – ID of Box (string)
- $caption – caption of Box if needed (string)
- $atts – extended attributes of Box (array)
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
atts = array( 'id' => 'warning', 'mode' => '', 'level' => 0, 'caption' => '', 'defcaption' => '', 'color' => '', 'ccolor' => '', 'bcolor' => '', 'bgcolor' => '', 'bgcolorto' => '', 'cbgcolor' => '', 'cbgcolorto' => '', 'bwidth' => '', 'image' => '', 'big' => '', 'float' => 'false', 'align' => 'left', 'width' => '200', 'collapsed' => '', 'mtop' => '', 'mleft' => '', 'mbottom' => '', 'mright' => '', 'direction' => '', 'collapsing' => 'default', 'shadow' => '' ); |
- color – body font color (six HEX digits of color without # as string)
- ccolor – caption font color (six HEX digits of color without # as string)
- bcolor – border color (six HEX digits of color without # as string)
- bgcolor – background color (CSS mode) or start color of background gradient (Javascript mode) (six HEX digits of color without # as string)
- bgcolorto – stop color of background gradient (Javascript mode only) (six HEX digits of color without # as string)
- cbgcolor – caption background color (CSS mode) or start color of caption background gradient (Javascript mode) (six HEX digits of color without # as string)
- cbgcolorto - stop color of caption background gradient (Javascript mode only) (six HEX digits of color without # as string)
- image – full URL of pictogram image. Use null value as URL to disable image output (string)
- big – use this parameter in case plugin settings are different with your needs. May be true or false (boolean as string). CSS mode only.
- mode - drawing mode (css|js)
- float – turn on floating mode of Special Text Box. May be true or false. (string)
- align – alignment of box in float mode. May be left or right. (string)
- width – width of box in float mode (pixels) (string)
- collapsed – display STB in collapsed mode if collapse/expand mode enabled. May be true or false. (string)
- mleft – left margin in px.
- mright – right margin in px.
- mtop – top margin in px.
- mbottom – bottom margin in px.
- collapsing – allow/disable collapsing (default|true|false)
- defcaption - allow using name of style as caption of block (true|false)
- direction - language direction (default|ltr|rtl)
- level – nesting level of the block. Only Javascript mode. Allows you to defer the drawing of the indoor block as long as parent block will be drawn. (0|1)
- shadow – enables/disables shadow of block vs default settings
You can partially define atts array (version 2.0.22+). For example:
|
1 2 3 |
<?php stbHighlightText('This is content', 'warning', 'This is caption', array('image' => "http://www.simplelib.com/images/wp-b.png", "big" => "true")); ?> |
or
|
1 2 3 4 5 6 |
<?php if(class_exists('StbBlock')) { $block = new StbBlock('This is content', 'warning', 'This is caption', array('image' => "http://www.simplelib.com/images/wp-b.png", "big" => "true")); echo $block->block; } ?> |
In this example the image of block was redefined as “wp-b.png” image and this one was defined as big image.
Inserting Special Text Box into Special Text Box
If you want insert one STB to another, you can use additional short code “stb“. For example:
CSS mode

Javascript mode

Special Text widget

Special Text widget. Admin Page
Download
Special Text Boxes
Highlights any portion of text as text in the colored boxes.
Author: minimus, version: 4.3.72, updated: February 13, 2012,
Requires WP version: 3.0 or higher, tested up to: 3.3.2.
Download (66 401 hits) 



(32 votes)
Tests

2. Mozilla FireFox 3 .. 9
3. Opera 10.0 .. 11.52
4. Google Chrome 1.0.154.53 .. 15.0.874.121
5. Apple Safari 3.1.2 .. 5.1.1
Awards
© 2009 – 2013, minimus. All rights reserved.
Popularity: 97%



I have a strange issue when I install/enable your plugin – I can’t update any plugins or use any plugins that make calls to external websites.
Soon as I disable your plugin? Things work again.
Any idea what could be up?
Thanks – and great plugin btw!
Total Comments by Jason Mathes: 2
Hi There, I love this plugin, but it doesn’t seem to work with WordPress 3.5. The icon does not show up in the Visual Editor. Help! Thank you.
Total Comments by dementiatoday: 2
All works! Tested! Just select any text…
Maybe some other plugin is generating a bug…
True – at this point who knows what it could be. Just knew that when I disabled this one things magically started working. I’ll have to take a look again! Thanks!
Total Comments by Jason Mathes: 2
Hey! Is it possible to remove all the Icons and just use centered text. When I remove images and enter text in the box there is still empty space in left where the icon was. How to remove that empty space?
Total Comments by whome: 3
Using javascript box without caption.
Total Comments by whome: 3
Phhwww sorry for spamming. I found the code for it image=”null”
Total Comments by whome: 3
I have installed the Special Tex Box plugin to my website and my intention was to have 5 floating text boxes (3 floated left and 2 floated right). I am a complete amateur so I tend to make an “un”educated guess on the short codes etc. The floating works correctly on IE and safari however does not workcorrectly in Mozilla Firefox or Opera. In Mozilla Forefox and Opera only the first floated text box is shown and scroll bars appear in the body of page.
I have used
the page in question is http://www.rapturephotography.com.au/packages/
Any help with what I did wrong would be appreciated
Total Comment by Kristel P: 1
It works – my WP is 3.5.1. Thanks a lots
Total Comment by Học Nguyễn: 1
On this page examples, I see nice shades filling the boxes. I’m using the plugin in the latest wordpress 3.5.x and I can’t see the same shades. The boxes are filled of a flat color, i.e. the warning box is Orange caption bar and thin border and it is filled of a really light orange.
Can you kindly explain how to obtain the same graphic effect?
P.S. on the wordpress plugins page, this plugin is reported to be tested up to wordpress 3.3.x , are you planning to update its compatibility?
Thank you
Robert
Total Comment by Robert: 1
Hi Minimus,
How can I reduce the spacing that appears after the special text box. On my website, the spacing is too large. Also, I noticed a possible bug where a gray line appears after the special text box on my website. Any ideas on how to fix it?
Thank you, Jennifer
Total Comments by Jennifer: 2
Hi,
I am trying to create several of the same text boxes on one page but it will only let me do one. The others appear as plain text out of a text box. Why is this? What do I need to do?
They are just plain CSS boxes.
Total Comment by Sue Deal: 1
One of my clients is using this plugin on her website and has immediately experienced slow-loading times. I’ve installed the P3 Plugin to check on what is causing the drag and it appears that your plugin is the culprit. Any ideas?
Total Comment by Jami Howard: 1