Dynamically re-enable/disable automatic paragraph generation
With the oik-css plugin you can choose to disable automatic paragraph generation across the whole site. Or you can control it manually using the [bw_autop] shortcode.
When you first install oik-css (v0.7 or higher) the default is to continue to allow automatic paragraph generation. i.e. The checkbox is not ticked.
In this situation, WordPress will automatically create paragraphs around un-styled content.
Sometimes, especially when there are lots of shortcodes, this causes a problem. The generated HTML becomes unwieldly and difficult to style… or worse.
When the checkbox is ticked, the automatica paragraph creation logic is disabled. But this can lead to another problem. If you don’t specifically add paragraph tags then all the content can become scrunched up.
The nice little space you left has now disappeared!
And to compound the problem, when using the Visual editor, you can’t easily wrap your lines in paragraph tags. Selecting the Paragraph button simply removes any previous tag and replaces it with nothing. And if you do type p tags in the Text editor switching back to the Visual editor often causes them to disappear again.
To help in this regard oik-css supplies the bw_autop shortcode to override the global behaviour.
Disabled? | Shortcode in content | Automatic paragraphs? |
---|---|---|
No | None | |
No | [bw_autop] | |
No | [bw_autop off] | |
Yes | None | |
Yes | [bw_autop] | |
Yes | [bw_autop off] |
Note: The current value of the Disable automatic paragraph creation checkbox is Yes
Since we always want you to be able to read this with automatically generated paragraphs we’re using…
[bw_autop]