Code

[code] shortcode arguments
language:
Language [html|css|scss|less|php|js|json|sql] (default: WP shortcode)
title:
Title
show_language:
Show language name in the title (default: true)
Highlighted shortcode
Button
Shortcode
<button red large>Hello</button>
<code title="Button"><button red large>Hello</button></code>
HTML
<button asd="wqe">hello</button>
<code language="html">{lt}button asd="wqe"{gt}hello{lt}/button{gt}</code>
CSS
button.big#bad { 
  background-color: transparent; 
}
<code language="css">
button.big#bad { 
  background-color: transparent; 
}
</code>
LESS
button {
  &.big {
    &#bad {
      background-color: transparent; 
    }
  }
}
<code language="less">
button {
  &.big {
    &#bad {
      background-color: transparent; 
    }
  }
}
</code>
SASS
button {
  &.big {
    &#bad {
      background-color: transparent; 
    }
  }
}
<code language="scss">
button {
  &.big {
    &#bad {
      background-color: transparent; 
    }
  }
}
</code>
CSS
button.big#bad { 
  background-color: transparent; 
}
<code language="css">
button.big#bad { 
  background-color: transparent; 
}
</code>
PHP
<?php echo 'Lorem'; ?>
<code language="php">{lt}?php echo 'Lorem'; ?{gt}</code>
JavaScript
console.log('Lorem', var);
<code language="js">console.log('Lorem', var);</code>
JSON
{
  "name": "chap",
  "version": "1.0.0",
  "author": "websevendev <websevendev@gmail.com>"
}
<code language="json">
{
  "name": "chap",
  "version": "1.0.0",
  "author": "websevendev {lt}websevendev@gmail.com{gt}"
}
</code>
SQL
INSERT INTO STATION VALUES (13, 'Phoenix', 'AZ', 33, 112);
<code language="sql">
INSERT INTO STATION VALUES (13, 'Phoenix', 'AZ', 33, 112);
</code>
Code highlighting features in Chap WordPress theme are powered by Prism JS syntax highlighter plugin.

Leave a comment

Your email address will not be published. Required fields are marked *