• I have a fairly large string of code that I put at the bottom of every post. It’s always the same and I always have to copy/paste it from another post or a saved document. Is there a way to save it and paste it via a toolbar button, whenever I want.

    I really thought Ultimate Tiny MC would have this feature but I can’t seem to find it.

    Any help is appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Do you use a plugin to allow code in post content?

    Thread Starter Zendon

    (@zendon)

    I don’t think so… Maybe code is the wrong word.

    It’s basically a string of text that’s had special formatting. ie-particular font size, color, style, and hyperlinked.

    Finding help with WordPress is easy… the hardest part is knowing how to ask for it.

    Moderator keesiemeijer

    (@keesiemeijer)

    Maybe the shortcode Api could work for you.
    http://codex.wordpress.org/Shortcode_API

    Try it with this in your theme’s functions.php:

    function paste_text_callback( $atts ) {
    	$text = <<<'TEXT'
    Paste your text here
    
    This is a new 'paragraph
    TEXT;
    
    	return apply_filters('the_content', $text);
    }
    add_shortcode( 'paste_text', 'paste_text_callback' );

    Paste your text between the TEXT tags.

    Now you can use this in your post content: [paste_text] and it will be replaced by the text.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Saving code and pasting it anytime?’ is closed to new replies.