How Do I Add a Clock Widget to WordPress?
on 25 August, 2022
No Comments
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: