Site icon Experience Wordpress Developer Online – Design Develop and Maintenance Support

How to create your own WordPress shortcode

Added below code to your function.php file of your active child theme (or theme).

add_shortcode('display_shortcode','my_shortcode');
function my_shortcode()
{
 echo "hello world"; // write here your html code what ever you display
}

or

  • Added below code if you want to use this shorcode in your widget:
  • [display_shortcode]
    
    Exit mobile version