You have to use the Code block the block editor (aka Gutenberg). It does not do anything with code tags on their own.
Thread Starter
macnux
(@macnux)
Thanks for reply!
What about the existing code tags?
I have hundreds of articles that contain code snippets.
I can do any regex replacement for the entire database if needed.
Regards,
You will need to convert your content over to blocks. Existing code tags will not be processed by this plugin.
Thread Starter
macnux
(@macnux)
I edit one of my current posts using block editor and I add a new code block and add some code and save and no code highlight!!
Thread Starter
macnux
(@macnux)
Also, I use the following code in functions.php of my template to change the default theme:
add_filter(
'syntax_highlighting_code_block_style',
function() {
return 'github';
}
);
But nothing changed.
In the block editor, please switch to the code editor and copy the text content here.
Do you see code like:
<!-- wp:code -->
<pre class="wp-block-code"><code>echo "Hello World!";</code></pre>
<!-- /wp:code -->
Try also setting some of the options, like showing line numbers, adding line wrapps, and setting the language:
<!-- wp:code {"language":"php","showLineNumbers":true,"wrapLines":true} -->
<pre class="wp-block-code"><code>echo "Hello World!";</code></pre>
<!-- /wp:code -->
Please confirm these settings are shown and are being applied.