AJB Random Quote Cards

Description

AJB Random Quote Cards lets you build a library of quotes and display them anywhere on your site as styled cards. Every page load can show a different random quote, or you can use Quote of the Day mode to show the same quote for a full 24 hours before rotating.

Quotes are managed through a clean, purpose-built form — no Gutenberg editor confusion. Add your quote text, author, an optional link, assign categories, and mark favourites, all in one clear screen.

Key features:

  • Display quotes using a simple shortcode or a native Gutenberg block
  • Random mode — a new quote on every page load
  • Quote of the Day mode — one quote per day, cached for performance
  • Full typographic control — font, size, colour, style, and weight for both quote and author text
  • Google Fonts support — type any font name and it loads automatically
  • Copy to clipboard button on every card
  • Optional “Learn More” external link per quote
  • Categories — organise quotes and filter by category in the shortcode or block
  • Favourites — mark quotes and display only favourites when you want
  • Author prefix and suffix — customise how the author name is presented
  • Four layout modes — block centre, block left, block right, and inline
  • Per-card style overrides — every visual setting can be changed per shortcode or block
  • Responsive — cards never overflow on mobile
  • CSV bulk import and export — with multi-category support using pipe or comma separators
  • 15 sample quotes included on activation so you can see it working straight away
  • Conditional asset loading — CSS and JS only load on pages that actually use a quote card

Gutenberg block:

The native “Random Quote” block (found under Widgets in the block inserter) gives you all the same options as the shortcode, configured directly in the Inspector sidebar — no code needed.

Shortcode:

The basic shortcode is simply [ajbq_quote]. Use the built-in Shortcode Builder page to generate your shortcode visually with colour pickers and a live preview, then copy it with one click.

Screenshots

Blocks

This plugin provides 1 block.

  • Ajbq Random Quote

Installation

  1. Upload the ajb-random-quote-cards folder to the /wp-content/plugins/ directory, or install directly through the WordPress Plugins screen.
  2. Activate the plugin through the Plugins screen.
  3. Go to AJB Quotes Add New to add your first quote.
  4. Go to AJB Quotes Settings to set your global default styles.
  5. Add a quote card to any page or post using the Random Quote block in the block editor, or use the Shortcode Builder tab to generate a shortcode.

FAQ

How do I display a quote on a page?

There are two ways. In the block editor, click the + icon to add a block and search for “Random Quote” — it appears under Widgets. Alternatively, go to AJB Quotes Shortcode Builder, configure your options, copy the generated shortcode, and paste it into any page, post, or widget.

Can I show a different style card on the same page?

Yes. Every visual setting can be overridden per shortcode or block. Add two shortcodes or blocks to the same page and configure each one differently — they are completely independent.

What is Quote of the Day mode?

When you set mode="daily" in the shortcode, or select “Quote of the Day” in the block, the plugin picks one quote at midnight and shows the same quote to all visitors for the full 24 hours. The selection is cached for performance. You can clear the cache manually from the Settings page.

How do I use Google Fonts?

Go to Settings and type the exact font name from fonts.google.com into the Font Family field — for example Merriweather or Playfair Display. The plugin loads the font automatically. Spelling and capitalisation must match exactly.

Can I import quotes in bulk?

Yes. Go to AJB Quotes Import / Export and upload a CSV file. Columns in order: Quote, Author, External Link, Category, Is Favourite. Multiple categories can be separated with a pipe | or comma ,. Duplicate quotes are detected and skipped automatically.

Does it work with caching plugins?

Yes. If you use a full-page caching plugin, enable the “Always load assets” option in Settings to ensure the CSS and JS are always available on cached pages.

What happens to my quotes if I delete the plugin?

All quotes, categories, settings, and cached data are removed automatically when you delete the plugin via Plugins Delete in the WordPress admin. Removing the plugin files via FTP bypasses this cleanup.

Reviews

There are no reviews for this plugin.

Contributors & Developers

“AJB Random Quote Cards” is open source software. The following people have contributed to this plugin.

Contributors

Changelog

2.1.0

  • Add/Edit quote now uses a clean purpose-built form — quote textarea, admin label, author, external link, category checkboxes, and favourite toggle all in one screen
  • Block editor disabled for the quote post type to avoid the blank editor experience
  • Colour pickers added to the Shortcode Builder page
  • Social sharing buttons removed — copy to clipboard is retained
  • Uninstall switched to register_uninstall_hook() with direct database cleanup for reliability
  • Responsive fix — cards use max-width: 100% and word-wrap so they never overflow on mobile
  • Auto-append px to bare dimension values; auto-prepend # to bare hex colour values — in both the PHP renderer and the Shortcode Builder JS
  • Width attribute ignored and stripped from generated shortcode when layout is inline
  • All placeholder text simplified — shows example values directly without e.g. prefix
  • All admin postbox headings given consistent left padding
  • Sample quotes seeded on first activation (15 quotes across 6 categories)

2.0.0

  • Quote text moved from post_title to post_content — no more truncation of long quotes in the admin list. Automatic one-time migration for existing quotes.
  • Conditional frontend asset loading — CSS and JS only load on pages that actually use a quote card, not site-wide
  • Native Gutenberg block registered (ajbq/random-quote) — server-side rendered, all shortcode attributes available as Inspector controls, no build step required
  • Multi-category CSV import — pipe or comma separator supported
  • AJB Quotes menu label to avoid clashing with other plugins
  • Prefix/suffix can now be set to blank (sentinel value fix)
  • Shortcode Builder updated with block notice and improved descriptions
  • Help & Tips page updated with Gutenberg block guide
  • Import page now shows full CSV format reference table

1.0.0

  • Initial release
  • Custom post type and taxonomy, shortcode, global settings, CSV import/export, per-card style overrides, Shortcode Builder, daily quote caching, Google Fonts support, social sharing, copy to clipboard