![](https://wpdevkit.in/wp-content/themes/twentytwenty-child/imgs/post01.jpg)
How to create a short code in wordpress?
![](https://wpdevkit.in/wp-content/themes/twentytwenty-child/li_st1.png)
![](https://wpdevkit.in/wp-content/themes/twentytwenty-child/li_st1.png)
![](https://wpdevkit.in/wp-content/themes/twentytwenty-child/li_st1.png)
![](https://wpdevkit.in/wp-content/themes/twentytwenty-child/imgs/kand5.png)
Create a short code in wordpress
function my_shortcode() { //buffering //Object Start ob_start(); date_default_timezone_set('asia/kolkata'); //echo date('H:i:s'); echo '<div id="mytime"></div>'; // object get contents $output_string = ob_get_contents(); // clean object ob_end_clean(); return $output_string; } add_shortcode("clock","my_shortcode");
![](https://wpdevkit.in/wp-content/themes/twentytwenty-child/author.jpg)
POST COMMENTS