• Hi guys,

    I have a chunk of code that i use on multiple pages within my theme. Rather than keep cutting and pasting the code, what is the shortcut that allows me to insert it with just a command? I’ve used it before but for the life of me i can’t remember.

    Thanks,

    Patrick

Viewing 1 replies (of 1 total)
  • Putting the following into your theme’s functions.php

    This one starts a table

    function ts() {
    	return '<table><tbody><tr><td>';
    	}
    	add_shortcode('ts', 'ts');

    the ‘return’ line adds the code, so amend it to what you want, and amend ts to whatever memorable code you want

    then just

    [ts] wherever you want it

    you get the idea?

Viewing 1 replies (of 1 total)
  • The topic ‘Shortcut for inserting code’ is closed to new replies.