Select Page

# Code Snippet Module

for Divi, Extra and the Divi Builder plugin

This WordPress plugin lets you easily display source code within your Divi Builder pages.

• Adds a new code snippet module to Divi
• Syntax highlighting with 73 styles to choose from
• 154 programming languages supported
• Seamless escaping and encoding
• Automatic line numbers

## Integrated with Divi Builder

The Code Snippet Module plugin adds a code snippet module to the standard Divi Builder which you can use just like you would any other Divi Module. It works with Divi, Extra, and the Divi Builder plugin and is Visual Builder compatible.

## Syntax Highlighting

Make the code in your posts easy to read with the Code Snippet module's clever syntax highlighting. Choose from 73 different color schemes.

``````// Calculate the nth fibonacci number
function fibonacci(\$n) {
return round(pow((sqrt(5)+1)/2, \$n) / sqrt(5));
}``````
``````// Calculate the nth fibonacci number
function fibonacci(\$n) {
return round(pow((sqrt(5)+1)/2, \$n) / sqrt(5));
}``````
``````// Calculate the nth fibonacci number
function fibonacci(\$n) {
return round(pow((sqrt(5)+1)/2, \$n) / sqrt(5));
}``````
``````// Calculate the nth fibonacci number
function fibonacci(\$n) {
return round(pow((sqrt(5)+1)/2, \$n) / sqrt(5));
}``````
``````// Calculate the nth fibonacci number
function fibonacci(\$n) {
return round(pow((sqrt(5)+1)/2, \$n) / sqrt(5));
}``````
``````// Calculate the nth fibonacci number
function fibonacci(\$n) {
return round(pow((sqrt(5)+1)/2, \$n) / sqrt(5));
}``````

## Automatic Language Detection

The Code Snippet Module can automatically detect and perform syntax highlighting for 154 languages. So whichever language you use, your code will look great.

Bash
``````for i in 1 2 3 4 5
do
# must have at least one command in loop
echo \$i  # just print value of i
done``````
C/C++
``````int sum = 0;
for (int i = 1; i < 6; ++i) {
sum += i;
}``````
JavaScript
``````for (var key in array) {
// Do something with array[key]
}``````
Python
``````for counter in range(1, 6):  # gives values from 1 to 5 inclusive
# do something here``````
PHP
``````for (\$i = 0; \$i <= 5; \$i++)
{
for (\$j = 0; \$j <= \$i; \$j++)
{
echo "*";
}
echo "<br>";
}``````
Ruby
``````5.times do |counter|  # counter iterates from 0 to 4
# statements
end``````

## Powerful Customization Options

The Code Snippet Module gives you control over how your code is displayed. Add line numbers, adjust tab sizes, or apply custom CSS to get the look you want.

``````/* Blog Posts */
.et_pb_post {
margin-bottom: 42px;
}``````
Fix Tab Sizes
``````/* Blog Posts */
.et_pb_post {
margin-bottom: 42px;
}``````
``````/* Blog Posts */
``````/* Blog Posts */