How Do I Add a Clock Widget to WordPress?

Adding a clock widget to WordPress is easy. You just need to add the following code to your theme’s functions.php file:

function mytheme_clock() { global $clock; $clock = new WP_Clock(); $clock->start(); } add_action(‘widgets_init’, ‘mytheme_clock’);

Now you can display your clock widget anywhere in your WordPress site by adding the following line to your theme’s header.php file:


Finally, add the following code to your footer:

Conclusion

Adding a clock widget to WordPress is easy.

php file and display it anywhere in your WordPress site by adding the following line to your header.php file.