Welcome to ManageWP.org

Register to share, discuss and vote for the best WordPress stories every day, find new ideas and inspiration for your business and network with other members of the WordPress community. Join the #1 WordPress news community!

×

Easy-to-use Code Blocks in WordPress

xfive.co | Apr. 19, 2017 | 5 min read

If you really wanted to show a lot of code in a post, this guy has a way to do.

10 votes   Flag
Sallie Goetsch (rhymes with 'sketch')

It seems like a lot more trouble than using one of the code highlighting plugins--plus your editor is full of shortcodes. I think if I were using ACF for this, I'd use flexible content fields and write the template directly, so that you could just keep adding content blocks and code blocks in whatever alternation you wanted without having to go through the additional step of putting the shortcodes into the editor.

Reply
Lubos Kmetko

Thanks for the comment, Sallie. This was initially implemented for our website where we already use ACF and Timber. I've tried a couple of highlighting plugins, but I wasn't happy with any of them, often they are outdated or heavyweight (we don't use jQuery). But certainly your idea with flexible content fields could be a good alternative to this.

Reply
Lubos Kmetko

I forgot to mention that one advantage shortcodes have over the flexible content fields is that you can easily enter them to the lists. So you can have code samples in tutorials with steps like here www.xfive.co/blog/lightning-fast-social-media-buttons-with-counters/ (see the section #4).

Reply