Title: Time Based Button
Last modified: July 20, 2021

---

# Time Based Button

 *  [Amit Singh](https://wordpress.org/support/users/amitsksingh/)
 * (@amitsksingh)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/time-based-button/)
 * Hi All,
 * I am looking to create two buttons which changes after specific time and day.
   For example for first five hours I want to show one button and for next 5 hours
   I want to show other button. Is there any plugin to achieve this.
    -  This topic was modified 4 years, 10 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Moved to Fixing WordPress, this is not an Developing with WordPress
      topic

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [jaynarayan](https://wordpress.org/support/users/jaykpatel/)
 * (@jaykpatel)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/time-based-button/#post-14681532)
 * This is very specific functionality.
    You have to create custom plugin which 
   display the html markup of desired button based on current time.
 * Something like this
 *     ```
       <?php
       date_default_timezone_set('Ireland/Dublin');
       $date = date('h:i:s A', time());
       if ($date < 05:00:00 AM){
       echo 'good morning';
       }
       ?>
       ```
   
 * Create custom page template or shrotcode and put your logic in it.
 *  Moderator [Steven Stern (sterndata)](https://wordpress.org/support/users/sterndata/)
 * (@sterndata)
 * Volunteer Forum Moderator
 * [4 years, 10 months ago](https://wordpress.org/support/topic/time-based-button/#post-14682139)
 * I would not use a PHP solution for this because if you have any caching, the 
   PHP changes will not be reflected in the delivered site. Consider doing this 
   with Javascript/jQuery.
 *  Thread Starter [Amit Singh](https://wordpress.org/support/users/amitsksingh/)
 * (@amitsksingh)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/time-based-button/#post-14684226)
 * So, there is no paid or free plugin available to achieve this?
 *  [Ashish Kumar (Ashfame)](https://wordpress.org/support/users/ashfame/)
 * (@ashfame)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/time-based-button/#post-14686060)
 * hi [@amitsksingh](https://wordpress.org/support/users/amitsksingh/) This plugin
   should be what you are looking for [https://wordpress.org/plugins/timed-content/](https://wordpress.org/plugins/timed-content/)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Time Based Button’ is closed to new replies.

## Tags

 * [timed](https://wordpress.org/support/topic-tag/timed/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 4 participants
 * Last reply from: [Ashish Kumar (Ashfame)](https://wordpress.org/support/users/ashfame/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/time-based-button/#post-14686060)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
