WordPress Shortcode


/ Published in: PHP
Save to your folder(s)

Use [short] in a post to insert the text from the function.


Copy this code and paste it in your HTML
  1. function my_shortcode() {
  2. return '<h2>This is my heading</h2>
  3. <p>This is my text.</p>';
  4. }
  5. add_shortcode('short','my_shortcode');

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.