Title: Keep syntax-coloring on code-examples (with no theme)
Last modified: August 9, 2023

---

# Keep syntax-coloring on code-examples (with no theme)

 *  Resolved [sofho](https://wordpress.org/support/users/sofho/)
 * (@sofho)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/keep-syntax-coloring-on-code-examples-with-no-theme/)
 * Hi.
 * Any tips on keeping the code/color syntax in the <pre> blocks when operating 
   with a custom theme? It looks like there is some extra script running on the “
   ChatGPT” and “Messages (iOS)” themes that add extra classes and thereby the syntax-
   coloring.
 * I’ve imported the “_codeLight.scss” from the plugin theme, but it only works 
   partially, as no extra classes are created.
 * Is it possible to still invoke til script on a custom theme?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [sofho](https://wordpress.org/support/users/sofho/)
 * (@sofho)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/keep-syntax-coloring-on-code-examples-with-no-theme/#post-16959279)
 * Ah. It looks like highlight.js has issues on my custom theme. I’m getting some“
   Could not find class for hljs-title”-errors (along with similar errors for “keyword”
   and “string”) in the console.
 * Still investigating.
 *  Plugin Support [Val Meow](https://wordpress.org/support/users/valwa/)
 * (@valwa)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/keep-syntax-coloring-on-code-examples-with-no-theme/#post-16961144)
 * Hey [@sofho](https://wordpress.org/support/users/sofho/) !
 * You can go to AI Engine settings and turn on “Syntax Highlight”. It will automatically
   add the class to the text in the pre element. 👌
 *  Thread Starter [sofho](https://wordpress.org/support/users/sofho/)
 * (@sofho)
 * [2 years, 10 months ago](https://wordpress.org/support/topic/keep-syntax-coloring-on-code-examples-with-no-theme/#post-16961745)
 * Thank you for the quick reply.
 * Syntax-hightlightning is already on – and it works when using the default themes“
   ChatGPT” and “Messages (iOS)”. It also partially works for my custom theme, as
   a few words are getting highligted (in my case the “document”-word of a javascript
   example).
 * But the default plugins seem to have extra classes added through javasript, most
   likely via the highlight-script, that I’m not getting on a custom theme.
 * In the console i get a set of errors (see my comment above), which seems to confirm
   that there is an issue classes.
 * It looks like the “no theme” option is missing a class for the highlight-syntax
   to run correcly, but I’m having a hard time determining what this class is and
   how I should add it through my custom theme.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Keep syntax-coloring on code-examples (with no theme)’ is closed to new
replies.

 * ![](https://ps.w.org/ai-engine/assets/icon-256x256.png?rev=3431928)
 * [AI Engine - The Chatbot, AI Framework & MCP for WordPress](https://wordpress.org/plugins/ai-engine/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ai-engine/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ai-engine/)
 * [Active Topics](https://wordpress.org/support/plugin/ai-engine/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ai-engine/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ai-engine/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [sofho](https://wordpress.org/support/users/sofho/)
 * Last activity: [2 years, 10 months ago](https://wordpress.org/support/topic/keep-syntax-coloring-on-code-examples-with-no-theme/#post-16961745)
 * Status: resolved