Interactive · Gutenberg
Trivia Game block for WordPress
A timed multiple-choice trivia game with built-in questions across Science, History, Geography, and Pop Culture categories.
Get Blockenberg
Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.
What it actually does
A timed multiple-choice trivia game with built-in questions across Science, History, Geography, and Pop Culture categories.
Inspector panels on this block: Content, Game Settings. Those titles come from index.js, not from a shared template.
Behavior controls: “Category” options: Mixed (all), Science & Nature, History, Geography, Pop Culture & Entertainment; “Difficulty” options: Mixed, Easy, Medium, Hard.
Where to find it
Gutenberg inserter → Interactive → search “Trivia Game” (block name `blockenberg/trivia-game` in block.json). Style it in the sidebar after insert.
How to use Trivia Game block for WordPress
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Trivia Game”, insert it. Category: Interactive.
- Configure inspector controls that exist on this block. Open Content. Set “Category”, “Difficulty”, “Questions per Round”, “Seconds per Question”.
- Check the published page. The view script reads HTML data attributes: data-opts. The block editor preview may not run the same view script.
Inspector controls from this block’s code
| Control | What the code does |
|---|---|
| Category | Select control; the chosen value is saved on the block. Options: Mixed (all); Science & Nature; History; Geography; Pop Culture & Entertainment; Sports; Technology. block.json default: mixed. Saved as `category`. |
| Difficulty | Select control; the chosen value is saved on the block. Options: Mixed; Easy; Medium; Hard. block.json default: mixed. Saved as `difficulty`. |
| Questions per Round | Numeric range control in the inspector. Range 3–30. block.json default: 10. Saved as `questionsPerRound`. |
| Seconds per Question | Numeric range control in the inspector. Range 5–60. block.json default: 20. Saved as `timePerQuestion`. |
| Show Timer | On/off toggle in the inspector. On by default. Saved as `showTimer`. |
| Show Progress Bar | On/off toggle in the inspector. On by default. Saved as `showProgress`. |
| Show Answer Explanation | On/off toggle in the inspector. On by default. Saved as `showExplanation`. |
| Accent | Color control in the inspector. block.json default: #6366f1. Saved as `accentColor`. |
| Correct Answer | Color control in the inspector. block.json default: #22c55e. Saved as `correctColor`. |
| Wrong Answer | Color control in the inspector. block.json default: #ef4444. Saved as `wrongColor`. |
| Card Background | Color control in the inspector. block.json default: #ffffff. Saved as `cardBg`. |
| Section Background | Color control in the inspector. block.json default: #f0f4ff. Saved as `sectionBg`. |
| Title Color | Color control in the inspector. block.json default: #1e1b4b. Saved as `titleColor`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-opts.
- JavaScript functions that perform the math: makeScoreItem, updateScoreBar.
When this is the right block
- A timed multiple-choice trivia game with built-in questions across Science, History, Geography, and Pop Culture categories — that is the job of Trivia Game, not a generic content block.
- Use it when you need the editor control labeled “Category”, which exists on this block’s inspector.
- It matches pages about trivia, quiz, game.
- The math runs in the visitor’s browser after publish — no extra calculator plugin.
Notes from the implementation
viewScript: this folder’s frontend.js is enqueued on the front end for this block.
FAQ
How do I add the Trivia Game block in WordPress?
Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Trivia Game”. It sits under Interactive. After insert, open Content and set “Category”, “Difficulty”, “Questions per Round”, “Seconds per Question”.
Does Trivia Game need a server or extra plugin?
No. After Blockenberg is active, the view script runs in the browser with the values you saved on the block.
Is the Trivia Game Gutenberg block free?
Yes. Trivia Game ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.
Can I style Trivia Game to match my theme?
Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Content, Game Settings).
Related interactive blocks
Knowledge Check
Quick quiz question with instant reveal — great for educational content, articles, and explainers.
Bingo Card
Interactive 5×5 Bingo card with number calling, win detection, and celebration animations.
Snake Game
Classic Snake game playable in the browser. Keyboard and on-screen touch controls, high-score tracking, multiple speed levels and color themes.
Word Scramble
Interactive word unscramble game with categories, hints, scoring, and timer. Multiple difficulty levels.
2048 Game
The classic sliding-tile 2048 puzzle. Swipe or use arrow keys to merge tiles and reach the 2048 tile.
Dice Roller
Interactive dice roller supporting d4, d6, d8, d10, d12, d20 and d100. Roll multiple dice, see individual results, totals, and past roll history.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Trivia Game from the Gutenberg inserter.