1// function that runs when shortcode is called
2function wpb_demo_shortcode() {
3
4// Things that you want to do.
5$message = 'Hello world!';
6
7// Output needs to be return
8return $message;
9}
10// register shortcode
11add_shortcode('greeting', 'wpb_demo_shortcode');
1<?php
2function abc()
3{}
4////create shortcode////
5add_shortcode('page_name','abc');
6?>