How to add the Code Block block and what every setting does. It is free in Bright Addons Blocks Library on WordPress.org, and Bright Addons Blocks Pro includes it too.
Start
Code with syntax colors, line numbers, highlighted lines, a file name and a copy button.
Panel 1 of 5
Open the block sidebar and find the Code panel.
| Setting | What it does | Choices |
|---|---|---|
| Language | Choose one. | Plain text, HTML / XML, CSS, SCSS, JavaScript, TypeScript, JSX, TSX, JSON, PHP, Python, Bash / Shell |
| Code | Shown exactly as typed. It is never run. | – |
| File name (optional) | Text you type. | – |
| Show the language | On or off. | – |
| Language label (optional) | Leave empty to use the language name. | – |
Panel 2 of 5
Open the block sidebar and find the Lines panel.
| Setting | What it does | Choices |
|---|---|---|
| Line numbers | On or off. | – |
| First line number | From 1 to 100000. | – |
| Highlight lines | Line numbers separated by commas. Ranges like 5-7 work too. | – |
| Wrap long lines | Off: long lines scroll sideways. | – |
Panel 3 of 5
Open the block sidebar and find the Copy button panel.
| Setting | What it does | Choices |
|---|---|---|
| Show the copy button | On or off. | – |
| Button text | Text you type. | – |
| Text after copying | Text you type. | – |
Panel 4 of 5
Open the block sidebar and find the Look panel.
| Setting | What it does | Choices |
|---|---|---|
| Theme | Choose one. | Dark, Light |
| Font size (px) | From 11 to 22. | – |
| Max height (px) | 0 shows all the code. Longer code scrolls inside the box. From 0 to 1200. | – |
Panel 5 of 5
Open the block sidebar and find the Colors panel.
| Setting | What it does | Choices |
|---|---|---|
| Background | Color picker. | – |
| Text | Color picker. | – |
| Accent (highlighted lines, functions) | Color picker. | – |
Questions
Yes. Code Block is one of the 62 free blocks of Bright Addons Blocks Library on WordPress.org. Bright Addons Blocks Pro includes it as well.
No. It is a block for the WordPress block editor (Gutenberg). Elementor is not needed. If you use Bright Addons Pro for Elementor on the same site, both plugins work side by side.
No. Each block loads only its own small CSS and JavaScript, and only on pages where it is used. Blocks you do not need can be switched off in Bright Blocks.
Yes. The blocks work with block themes and classic themes, and follow your theme fonts. Wide and full width alignment are supported.
Yes. Open Entrance animation in the sidebar and pick one of 40 animations with its duration and delay. Visitors who prefer reduced motion see no animation.
Bright Addons Blocks
Blocks Pro adds 99 Pro blocks, Pro effects for every block, Theme Templates and popups to the 62 free blocks.