WordPress.org

Ready to get started?Download WordPress

Forums

Insert Custom Code Snippets In Post? (9 posts)

  1. Andrew
    Member
    Posted 2 years ago #

    Is there a plugin to insert custom snippets of code into a post? It would make posting a lot easier.

  2. Troy Chaplin
    Member
    Posted 2 years ago #

    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?

  3. Andrew
    Member
    Posted 2 years ago #

    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.

  4. keesiemeijer
    moderator
    Posted 2 years ago #

    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/

  5. Troy Chaplin
    Member
    Posted 2 years ago #

    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

  6. adpawl
    Member
    Posted 2 years ago #

  7. Andrew
    Member
    Posted 2 years ago #

    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

  8. Lee Rickler
    Member
    Posted 2 years ago #

    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

  9. Andrew
    Member
    Posted 2 years ago #

    Okay, thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic