Question : add shortcode in wordpress
Answered by : important-ibex-1klblsgaedb6
// function that runs when shortcode is called
function wpb_demo_shortcode() {
// Things that you want to do.
$message = 'Hello world!';
// Output needs to be return
return $message;
}
// register shortcode
add_shortcode('greeting', 'wpb_demo_shortcode');
Source : https://www.wpbeginner.com/wp-tutorials/how-to-add-a-shortcode-in-wordpress/ | Last Update : Wed, 25 Mar 20