Creating Code Snippets
Creating a New Code Snippet
Navigate to Components > Easy Code Highlighter > Code Snippets and click the "New" button.
Required Fields
- Title: Enter a descriptive title for your code snippet (e.g., "PHP Array Example")
- Language: Select the programming language from the dropdown (PHP, JavaScript, CSS, HTML, etc.)
- Code: Paste your code in the code textarea
Optional Fields
- Highlight Lines: Enter line numbers to highlight (e.g., "1,3,5" or "10-15")
- Status: Set to Published to make it available for use
Saving and Getting Shortcode
After saving, you'll see the shortcode in the list view (e.g., [codehighlight id=1]). Copy this shortcode and paste it anywhere in your content.
Supported Languages
The component supports 20+ programming languages: PHP, JavaScript, CSS, HTML, XML, Java, Python, SQL, Bash, C++, C#, Ruby, Perl, PowerShell, SASS, Scala, VB.NET, and Plain Text.