Block-style page layouts for ClassicPress, delivered as shortcodes.
Why this exists
ClassicPress dropped the Gutenberg block editor in favour of the Classic editor. That’s a deliberate choice — but it leaves a gap: the layout primitives that came with blocks (cover, columns, media + text, buttons, accordions, etc.) disappear with them. Themes still know how to style alignfull / alignwide, but there’s no easy way to author those layouts in a Classic post.
FX Shortcodes fills that gap. Every layout block you’d reach for in Gutenberg is available as a shortcode, with the same visual result and the same alignment classes — but authored as plain [element] tags inside the Classic editor.
No JavaScript, no block editor, no React. Just one shortcode and a stylesheet.
How it works
FX Shortcodes Plugin page
Everything goes through one tag: [element]. Set the layout with type="…" (for example type="cover"). Paired blocks close with [/element]. Self-closing void blocks use a trailing slash: [element type="spacer" height="3rem" /].
Because the plugin parses [element] itself (innermost-first), same-name nesting works: you can put [element type="group"] … [/element] inside another group without WordPress closing on the first [/element].
Types (type attribute)
type | Role |
|---|---|
cover | Hero / cover |
group | Generic container |
section | Same renderer as group (semantic alias) |
columns | Column row |
column | Single column |
details | <details> |
accordion | Alias of details |
media-text | Media + text |
mediatext | Alias of media-text |
button | Button / link |
card | Card |
spacer | Spacer (void) |
separator | Rule (void) |
hr | Alias of separator |
line | Decorative line (void) |
colored-line | Alias of line |
Common attributes
These work on (almost) every block type:
| Attribute | Accepts | Notes |
|---|---|---|
class | space-separated CSS classes | merged onto the wrapper |
id | string | sets id="..." on the wrapper |
tag | div section article aside header footer main nav figure | wrapper element (where applicable) |
width | full wide or any CSS length | full → alignfull, wide → alignwide |
align | left center right | text alignment |
vertical-align | top center bottom | flex/grid item alignment |
background | image URL | sets background-image |
background-color | CSS color | |
text / color | CSS color | text color (text= is the WP-cover-style alias) |
padding | CSS length / shorthand | e.g. 2rem or 1rem 2rem |
margin | CSS length / shorthand | |
gap | CSS length | flex/grid gap |
border-radius / radius | CSS length | |
shadow | CSS box-shadow value | e.g. 0 4px 20px rgba(0,0,0,.1) |
min-height | CSS length | |
max-width | CSS length |
Cover
Full-bleed hero with optional background image, color overlay, and parallax.
Cover-specific attributes
| Attribute | Notes |
|---|---|
background | background image URL |
overlay | overlay color (rendered above image) |
overlay-opacity | 0–1, default 0.5 |
parallax | 1 / 0 — fixes background-attachment |
focal | CSS background-position, e.g. 30% 70% |
height / min-height | becomes min-height of the cover |
Group
Generic container. Use it for sections of content with a shared background, padding, or layout.
Plain
Flex layout
Grid layout (auto-fit)
Group-specific attributes
| Attribute | Notes |
|---|---|
layout | default (block), flex, grid |
justify | start center end space-between space-around |
Columns / Column
Equal columns by default; per-column span overrides flex-basis.
Two equal columns
Three columns, no stack on mobile
Asymmetric columns (1/3 + 2/3)
Columns-specific attributes
| Attribute | Notes |
|---|---|
columns | integer; default 2 |
stack | 1 / 0 — collapse to single column under 781px (default 1) |
span (on column) | flex-basis, e.g. 33%, 400px |
Details / Accordion
Native <details> element. [element type="accordion"] matches [element type="details"] (same renderer).
Closed by default
Open by default
Stack of accordions
Use a default group (not layout="flex") for a vertical list — flex would put them in a row.
Details-specific attributes
| Attribute | Notes |
|---|---|
summary | the always-visible header text |
open | 1 / 0 — initial state (default 0) |
Media & Text
Image on one side, text on the other. [element type="mediatext"] matches [element type="media-text"] (same renderer).
Media on the left (default)
Media on the right, stacks on mobile
Crop image to fill
The image stretches to match the height of the text column (like WordPress’ Crop image to fill toggle on the Media & Text block). The image is sized with object-fit: cover, so any aspect-ratio mismatch is cropped, not letter-boxed.
Media-text-specific attributes
| Attribute | Notes |
|---|---|
media | image URL |
media-alt | alt text |
media-position | left (default) or right |
media-width | CSS length; omit or 50% for equal columns (1fr / 1fr); e.g. 40% for a narrower media column |
stack | 1 / 0 — stack at narrow widths (default 1) |
crop | 1 / 0 — crop image to fill text column height (object-fit: cover); default 0 |
Button
Renders an <a> when url is set, otherwise a <button type="button">. Every button has a background color and a text color. On hover both states darken automatically using color-mix(in oklch, ...).
Solid (default)
The default palette is #2271b1 background with white text. Hover darkens the background by 15% in OKLCH space.
Outline, large
External link (auto adds rel="noopener noreferrer")
Custom colors — hover darkens automatically
Brand-accent button using a CSS color name
Button row inside a flex group
Tweaking the hover strength
The hover darkening percentage is exposed as a CSS variable on .fx-button (--fx-button-darken, default 15%). To override globally:
Button-specific attributes
| Attribute | Notes |
|---|---|
url | href; if omitted, renders a <button> instead of <a> |
target | _blank, _self, etc. — _blank auto-adds safe rel |
rel | overrides the auto-rel |
style | fill (default), outline, text |
size | small, default, large |
background-color | sets --fx-button-bg; hover is derived from this |
color (or text) | sets --fx-button-color |
Browser support: color-mix() requires Chrome 111+, Safari 16.4+, Firefox 113+ (all shipped 2023). On older browsers the hover rule is ignored and the button stays in its base state — still functional, just not animated.
Card
Optional image, title, body content, and an optional whole-card link.
Simple
Whole card linked
Card grid
Card-specific attributes
| Attribute | Notes |
|---|---|
image | image URL |
image-alt | alt text |
title | rendered as <h3> |
url | optional — wraps the card in a link |
target, rel | applied to the wrapping link |
Spacer
Invisible vertical (or horizontal) gap. Self-closing form is recommended.
Vertical (default)
Horizontal (inline)
Inside a flex layout
Spacer-specific attributes
| Attribute | Notes |
|---|---|
direction | vertical (default) or horizontal |
height | vertical mode size, default 2rem |
width | horizontal mode size, default 1rem |
Separator / HR
Visible thematic break (<hr>) with style variants. [element type="hr" /] matches [element type="separator" /] (same renderer).
Default short rule
Wide (full-container) rule
Dotted
Dashed
Double line
Colored, custom width, left-aligned
Inside a card
Separator-specific attributes
| Attribute | Notes |
|---|---|
style | default (short), wide, dots, dashed, double |
color (or text) | line color |
width | full, wide, or any CSS length (length sets the line width directly) |
align | left center (default) right |
Line / Coloured line
A more controllable decorative line than [element type="separator" /]. Renders three nested divs so you can independently control outer padding, horizontal alignment of the bar, and the bar’s own dimensions. Painted via three style variants — striped (default), dotted, shade — using currentColor.
[element type="colored-line" /] matches [element type="line" /] (same renderer).
Striped (default), 256×10px, centred
Dotted, full width
Shaded fade-in/fade-out
Solid bar (override background-color)
When you pass a non-transparent background-color you get a solid filled bar in addition to whatever the variant paints over it.
Left-aligned with extra vertical padding
Inside a card or section divider
Line-specific attributes
| Attribute | Notes |
|---|---|
style | striped (default), dotted, shade |
height | bar height; default 1px |
width | bar width; default 100% |
padding | outer wrapper padding; default 32px 0 |
background-color | bar background; default transparent (variant paints over it) |
color (or text) | drives currentColor for striped and dotted; default #000000. The shade variant ignores this. |
align | left center (default) right — sets the bar’s horizontal position via justify-content |
Nesting
Different type values nest arbitrarily ([element type="group"] containing [element type="columns"] …). Because parsing is innermost-first, [element] inside [element] is fully supported.
Paired vs void tags
| Form | Use for |
|---|---|
[element type="cover"]…[/element] (paired — swap type per layout) | cover, group, section, columns, column, details, accordion, media-text, mediatext, button, card |
[element type="spacer" height="3rem" /] / [element type="separator" /] / [element type="line" /] … | void blocks — single bracket pair, no closing tag |
Self-closing void tags (… /]) are recommended; an empty paired [/element] after a void type is unnecessary.