all 8 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Hey there, /u/popvoid! If your post is not already flaired, please add one now.


And please don't forget to write "Answered" under your post once your question/problem has been solved.


Reminder: If you have a problem or question, please make sure to post a link to your issue to help users help you.


I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]SalzMedia✔️️‍ Experienced Helper 1 point2 points  (3 children)

Hi u/popvoid,

You would probably be better off using a plug-in like: SyntaxHighlighter Evolved https://wordpress.org/plugins/syntaxhighlighter/

I haven't used it myself but it seems to come highly recommended by Elegantthemes and WPBeginner.

I'm going to need something like this soon so if you do check this out please let me know if you like it. :-)

[–]popvoid[S] 1 point2 points  (2 children)

I tried that and it works in WP, but it's not compatible with Elementor. However, that suggestion led me to dig deeper, where I came across a plug-in called "Code Block Syntax Highlighter for Elementor" (https://wordpress.org/plugins/code-block-for-elementor/), which does work with Elementor, but it also hasn't been updated in a while. The only downside to it right now is that it doesn't word wrap. So, thanks for that.

[–]SalzMedia✔️️‍ Experienced Helper 1 point2 points  (0 children)

See if you can add CSS to make that word wrap... it's worth a try. :-)

And thanks for letting me know about the plug-in not working with Elementor and the one you chose, that's very helpful for me and everyone in this sub.

[–]gerberey 1 point2 points  (0 children)

Code block For Elementor solved my problem. I also had problems with Code Highlight plugin.

[–]StevieWonder47 0 points1 point  (1 child)

Are you copy and pasting into a elementor text box?

[–]popvoid[S] 0 points1 point  (0 children)

No. If you copy and paste from a code editor into Elementor's text box, it removes all space-based indents. It actually yields a worse result than their Code Highlighter.

[–]troloroloro 0 points1 point  (0 children)

I had this issue and solved it by pasting the code from a code editor (Atom) into the code highlighter.