FX Shortcodes

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)

typeRole
coverHero / cover
groupGeneric container
sectionSame renderer as group (semantic alias)
columnsColumn row
columnSingle column
details<details>
accordionAlias of details
media-textMedia + text
mediatextAlias of media-text
buttonButton / link
cardCard
spacerSpacer (void)
separatorRule (void)
hrAlias of separator
lineDecorative line (void)
colored-lineAlias of line

Common attributes

These work on (almost) every block type:

AttributeAcceptsNotes
classspace-separated CSS classesmerged onto the wrapper
idstringsets id="..." on the wrapper
tagdiv section article aside header footer main nav figurewrapper element (where applicable)
widthfull wide or any CSS lengthfullalignfull, widealignwide
alignleft center righttext alignment
vertical-aligntop center bottomflex/grid item alignment
backgroundimage URLsets background-image
background-colorCSS color
text / colorCSS colortext color (text= is the WP-cover-style alias)
paddingCSS length / shorthande.g. 2rem or 1rem 2rem
marginCSS length / shorthand
gapCSS lengthflex/grid gap
border-radius / radiusCSS length
shadowCSS box-shadow valuee.g. 0 4px 20px rgba(0,0,0,.1)
min-heightCSS length
max-widthCSS length
Cover

Full-bleed hero with optional background image, color overlay, and parallax.

Cover-specific attributes

AttributeNotes
backgroundbackground image URL
overlayoverlay color (rendered above image)
overlay-opacity01, default 0.5
parallax1 / 0 — fixes background-attachment
focalCSS background-position, e.g. 30% 70%
height / min-heightbecomes 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

AttributeNotes
layoutdefault (block), flex, grid
justifystart 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

AttributeNotes
columnsinteger; default 2
stack1 / 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

AttributeNotes
summarythe always-visible header text
open1 / 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

AttributeNotes
mediaimage URL
media-altalt text
media-positionleft (default) or right
media-widthCSS length; omit or 50% for equal columns (1fr / 1fr); e.g. 40% for a narrower media column
stack1 / 0 — stack at narrow widths (default 1)
crop1 / 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

AttributeNotes
urlhref; if omitted, renders a <button> instead of <a>
target_blank, _self, etc. — _blank auto-adds safe rel
reloverrides the auto-rel
stylefill (default), outline, text
sizesmall, default, large
background-colorsets --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

AttributeNotes
imageimage URL
image-altalt text
titlerendered as <h3>
urloptional — wraps the card in a link
target, relapplied 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

AttributeNotes
directionvertical (default) or horizontal
heightvertical mode size, default 2rem
widthhorizontal 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

AttributeNotes
styledefault (short), wide, dots, dashed, double
color (or text)line color
widthfull, wide, or any CSS length (length sets the line width directly)
alignleft 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

AttributeNotes
stylestriped (default), dotted, shade
heightbar height; default 1px
widthbar width; default 100%
paddingouter wrapper padding; default 32px 0
background-colorbar background; default transparent (variant paints over it)
color (or text)drives currentColor for striped and dotted; default #000000. The shade variant ignores this.
alignleft 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

FormUse 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.