Are you trying to add code examples for users to read and reuse, or so you can execute code for functionality purposes on your post?
Thread Starter
Andrew
(@ndrwglrzayahoocom)
I’d like to make code snippets to easily insert them into my posts. It’s easier than having to type the code everytime I post something.
I’d like to make code snippets to easily insert them into my posts. It’s easier than having to type the code everytime I post something.
Still not really sure what you want.
Maybe this: http://wordpress.org/extend/plugins/syntaxhighlighter/
or this: http://codex.wordpress.org/Shortcode_API
or this: http://wordpress.org/extend/plugins/exec-php/
Andrew, can you clarify what you are trying to do? Either execute code snippets on posts, or display them in a tutorial like fashion for visitors?
If you are trying to execute code you should create shortcodes as the visual editor will remove code you put into it
If you want them to display for readers, there are good plugins out there to do that, Syntax Highlighter noted by keesiemeijer above is a really good one
Thread Starter
Andrew
(@ndrwglrzayahoocom)
Oh, I mean say a set of buttons on the post page that can insert code when you press them. Like preformatted tables or divs etc…
Thank you,
Andrew
Sounds like you’re looking to add shortcodes to the TinyMCE bar.
Look for something like this plugin to help:
http://wordpress.org/extend/plugins/shortcodes-pro/
Or look at writing your own shortcodes in the theme functions.php