Cards

Use cards to explain and link to a single idea. Because the entire card must be a single link, it’s perfect for linking to broad topics where you need more words or a photo to describe the linked resource. Linking to other landing pages is a perfect use case. For example, instead of providing a list of programs linked by name, cards can be used to illustrate the differences between the programs.


Overview

Here’s an example card:

Cards can contain any combination of media, a title, body text, and button text. On their own, cards take up the full width of the page on desktop browsers.

A more common usage is to place cards into columns, where they adopt the typical stacked layout:

For cards in columns, a cleaner look can be achieved by ensuring that each card’s image has the same aspect ratio. While images can be cropped in the WordPress media library, it is generally easier and more accurate to edit images prior to uploading them.

Cards can also be floated left or right. Floated cards have a stacked layout and take up about a third of the page width on desktop browsers.

Adding a Card

On sites using the Block Editor, cards (Card block editor icon) can be added from the block library, under the Component Library section. Card content can be edited directly.

On sites using the older Visual Editor, cards can be added by choosing the Card pictograph (Card WYSIWYG toolbar icon) from the editor’s toolbar. Use the editor dialogue to add content and adjust options. To edit the card later, double-click the card preview to show the editor dialogue again.


Technical Details

Cards can be implemented with the shortcode cl-card.

[cl-card title="Academics" body="See the world differently." img="academics.jpg" link="/academics" button="Learn More"]

Attributes

link

(string) (required)

The URL for the card.

img

(mixed) (optional)

The source URL for an image or Vimeo video, or a WordPress image ID

(default value: none)

feature

(string) (optional)

The source URL of a Vimeo video to be featured in a controllable player

(default value: none)

alt

(string) (optional)

Set alternate text for the image

(default value: WP media value)

title

(string) (optional)

The text for a title

(default value: none)

body

(string) (optional)

The body text

(default value: none)

button

(string) (optional)

Set text to add a button

(default value: none)

tooltip

(string) (optional)

The title attribute for the link

(default value: Explore)

float

(string) (optional) (values: left, right)

Set to float the card either left or right

(default value: none)

class

(string) (optional)

Set custom CSS class(es)

(default value: none)