[content_box]
The shortcode creates flexible content boxes with various media types, titles, descriptions, and call-to-action buttons.
Product
Shortcode Attributes
There are a number of shortcode attributes available which you can use to customize the output.
Content
- title – The title displayed in the content box
Link/Button
- link_type – Determines how the link is displayed
- Default:
button. - Options:
button,box,text,none. Specify one only.
- Default:
- button_target – Determines the link target type.
- Default:
link. - Options:
link,modal. Specify one only.
- Default:
- button_title – Text for the button/link.
- Default:
View. - Options: Any text value.
- Default:
- modal_data_open – Modal ID to open (when
button_target="modal").- Options: Any numeric value.
- link_url – URL for the link (when
button_target="link").- Options: Any URL.
- link_target – HTML target attribute for the link.
- Options:
_blank,_self,_parent,_top. Specify one only.
- Options:
Media
- media – Type of media to display.
- Default:
image. - Options:
image,gallery,video. Specify one only.
- Default:
- image – Image URL or WordPress attachment ID.
- Options: Any numeric value or URL.
- image_icon – Display image as icon.
- Default:
off. - Options:
on,off. Specify one only.
- Default:
- icon – Icon class or URL (used when
image_icon="on").- Options: Any URL. Font Awesome HTML if image icon is
off.
- Options: Any URL. Font Awesome HTML if image icon is
- gallery – List of image URLs or attachment IDs.
- Options: Any numeric value or URL. Use commas
,to separate.
- Options: Any numeric value or URL. Use commas
- lightbox – Enable lightbox for gallery.
- Default:
off. - Options:
on,off. Specify one only.
- Default:
- video – Accept Youtube or Vimeo video URL only.
- Options: Any URL.
Advanced
- classes – Additional CSS classes for the content box.
- id – Custom ID attribute for the element.
Shortcode Enclosed Content
Any content placed between [content_box] and [/content_box] will be used as a template, where {content} acts as a placeholder for the content box.
Example Usage
[content_box title="Our Services" image="123" button_title="Learn More" link_url="/services"]Lorem ipsum dolor sit amet...[/content_box]
[content_box title="Photo Gallery" media="gallery" gallery="123,456,789" lightbox="on"]Browse our collection of images[/content_box]
[content_box title="Watch Tutorial" media="video" video="https://youtube.com/watch?v=example"]Learn how to use our product[/content_box]
Results
| Example 1: This example displays a content box titled “Our Services” with an image (ID 123), descriptive text “Lorem ipsum dolor sit amet…”, and a “Learn More” button linking to /services.Example 2: This example displays an interactive photo gallery content box titled “Photo Gallery” displaying images with IDs 123, 456, and 789 in a lightbox, accompanied by the text “Browse our collection of images”.Example 3: This example displays a video content box titled “Watch Tutorial” that embeds a YouTube video from the specified URL and displays the accompanying text “Learn how to use our product”. |