Wordpress Shortcode


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



Copy this code and paste it in your HTML
  1. <?php function my_example() {
  2. return 'my example text';
  3. // or echo
  4. } ?>
  5. <?php add_shortcode('mytest', 'my_example');?>
  6.  
  7. Then add [mytest] to the post.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.