The Time Greeting Block is a WordPress plugin that automatically displays different greetings based on the current time of day. Instead of showing the same static welcome message all the time, your visitors will see “Good morning!” in the morning, “Good afternoon!” during the day, and “Good evening!” at night. You can also display the current date alongside these greetings.
This simple but effective plugin helps make your website feel more personal and engaging by acknowledging when your visitors arrive. Whether you’re running a business website, blog, or personal site, time-based greetings create a welcoming atmosphere that adapts throughout the day.
What the Plugin Does
The Time Greeting Block serves three main purposes:
Dynamic Greetings: The plugin automatically changes your greeting based on the time of day. You can set exactly when morning, afternoon, evening, and night periods begin, and the plugin will display the appropriate greeting for each time period.
Date Display: In addition to greetings, you can show the current date in various formats. This is particularly useful for business websites, news sites, or blogs where knowing the current date adds value for visitors.
Flexible Implementation: You can add time greetings to your site in multiple ways – through the modern WordPress block editor, using shortcodes in older content, or integrating with page builders like Bricks Builder.
How the Plugin Works
Time-Based Logic
The plugin works by checking the current time and comparing it against the time periods you’ve configured in the settings. By default, the plugin considers:
- Morning starts at 5:00 AM
- Afternoon begins at 12:00 PM (noon)
- Evening begins at 5:00 PM
- Night begins at 10:00 PM
You can adjust these times to match your preferences or business hours. For example, if you run a late-night business, you might want to start the evening later and have a custom message for very late hours.
Timezone Handling
The plugin respects timezone settings, so visitors from different locations can see greetings based on their local time or a specific timezone you choose. This is especially important for businesses that serve customers in multiple time zones or want to display greetings based on their business location rather than the visitor’s location.
Customizable Messages
While the plugin comes with standard greetings like “Good morning!” and “Good afternoon!”, you can customize the message that appears during late-night hours. This is useful for businesses that are closed after hours — you might display something like “It’s 11:30 PM ET and we’re closed, but we’ll be back in the morning!”
Using the Block Editor
Adding a Time Greeting Block
The easiest way to add a time greeting to your WordPress site is through the block editor (Gutenberg). When editing a page or post, click the plus button to add a new block and search for “Time Greeting” or look in the Widgets category.
Block Configuration Options
Once you’ve added the block, you’ll see several options in the sidebar:
Display Type: Choose what you want to show — just the greeting, just the date, or both together. This flexibility lets you use the block for different purposes on different pages.
Date Format: If you’re displaying dates, you can choose from common formats like “January 1, 2024” or “1/1/2024”, or create a custom format using standard date formatting codes.
Timezone Settings: Set a specific timezone for the greeting, which is useful if your business operates in a different timezone than your website server, or if you want all visitors to see greetings based on your business hours, regardless of where they’re located.
Text Alignment: Choose whether the greeting appears aligned to the left, center, or right of its container.
Live Preview
One of the best features of using the block editor is that you can see exactly how your greeting will look as you make changes. The block shows a live preview that updates immediately when you modify settings.
Using Shortcodes
Basic Shortcode Usage
If you’re working with older WordPress content, custom post types, or areas where the block editor isn’t available, you can use shortcodes instead. The basic shortcode is simple:
[time_greeting]
This displays the appropriate greeting based on the current time.
Shortcode Parameters
You can customize shortcode behavior using parameters:
Display Parameter: Control what appears by adding display="date" to show only the date, or display="both" to show both greeting and date.
Date Format Parameter: Customize how dates appear with date_format="M j, Y" or any other valid date format.
Timezone Parameters: Set specific timezones with timezone="America/Chicago" and tz_abbr="CT" to show the timezone abbreviation.
Shortcode Examples
Here are some practical examples of how you might use shortcodes:
[time_greeting display="both"]– Shows both greeting and today’s date[time_greeting timezone="America/Los_Angeles" tz_abbr="PT"]– Uses Pacific time[time_greeting display="date" date_format="l, F j, Y"]– Shows only the date in “Monday, January 1, 2024” format
Page Builder Integration
Bricks Builder Support
The plugin includes special support for Bricks Builder and similar page builders through a PHP echo function. In Bricks Builder, you can add a Code element and use:
<?php time_greeting_echo(); ?>
Custom Theme Integration
Developers can integrate time greetings directly into theme files using the same echo function. This is useful for adding greetings to headers, footers, or other template areas that appear across multiple pages.
Customizing Appearance
WordPress Theme Integration
The Time Greeting Block is designed to inherit styling from your WordPress theme automatically. This means the greeting text will match your theme’s font family, colors, and overall design without requiring additional configuration.
CSS Customization
For users who want more control over appearance, the plugin uses CSS custom properties (CSS variables) that make customization straightforward. You can modify aspects like:
Font Styling: Change the font weight of greetings, make date text italic, or adjust the overall font family.
Spacing and Layout: Adjust spacing between greeting and date text, modify padding when using background colors, or change how elements stack on mobile devices.
Color and Opacity: Control the opacity of date text, customize separator characters between greeting and date, or adjust colors for different theme variations.
Adding Custom CSS
You can add custom styling through three main methods:
Theme Customizer: The easiest approach is using Appearance > Customize > Additional CSS in your WordPress admin, where you can add custom styles and see them applied immediately.
Child Theme: For more permanent customizations, add CSS to your child theme’s stylesheet.
Custom Plugin: Developers can create small plugins to apply consistent styling across multiple sites.
Plugin Settings and Configuration
Time Period Settings
The plugin’s main settings page lets you configure when different time periods begin. You set these using a 24-hour format, so 17 means 5:00 PM. This granular control means you can match the greetings to your specific schedule or cultural norms.
Default Timezone Configuration
You can set a default timezone that applies to all time greetings unless overridden in individual blocks or shortcodes. This is particularly useful for businesses that want all greetings to reflect their local business hours.

Custom Night Messages
The plugin allows you to create custom messages for late-night hours when your business might be closed. These messages can include placeholders that automatically insert the current time and timezone abbreviation.
Tabbed Admin Interface
The settings page uses a tabbed interface that separates basic configuration from styling information. The Settings tab contains all the functional options, while the Styling tab provides comprehensive details on customizing the appearance with CSS.

Technical Features and Benefits
Performance Optimization
The plugin is built with performance in mind. CSS files only load on pages that actually use time greetings, and the JavaScript code is minimal and efficient. The plugin uses server-side rendering, which means the greeting appears immediately when the page loads rather than requiring additional loading time.
Accessibility Features
The plugin generates proper HTML markup with semantic time elements that screen readers and other assistive technologies can understand correctly. The heading structure and navigation are designed to work well with accessibility tools.
Clean Uninstallation
When you deactivate or uninstall the plugin, it automatically removes all its data from your WordPress database. This “good citizen” behavior ensures no orphaned data remains behind, keeping your database clean.
Modern WordPress Standards
The plugin is built using the latest WordPress Block API standards, ensuring compatibility with current and future versions of WordPress. It follows WordPress coding standards and best practices for security and performance.
Practical Use Cases
Business Websites
Professional service providers can use time greetings to acknowledge when clients visit their site, making the experience more personal. For example, a law firm might show “Good morning! Our offices open at 9 AM” during early hours.
E-commerce Sites
Online stores can use time-based greetings to create a more welcoming shopping experience and show current dates for time-sensitive promotions or shipping deadlines.
Blog and Content Sites
Content creators can use the plugin to make their sites feel more dynamic and current, showing readers both the greeting and current date to provide context for when they’re visiting.
Restaurant and Retail
Businesses with specific operating hours can customize messages to reflect when they’re open or closed, helping set appropriate expectations for visitors who might want to contact them or visit in person.
Getting Started
Installation and Setup
Installing the Time Greeting Block is straightforward through the WordPress plugin system. Once installed, the block becomes immediately available in the block editor, and shortcodes work right away with default settings.
Initial Configuration
After installation, visit the plugin settings page to configure your time periods and default timezone. These settings affect all new time greetings you create, though you can still customize individual instances as needed.
Testing Different Times
The plugin settings page includes a live preview that shows how your greetings look with the current settings. This preview updates automatically as you make changes, so you can see exactly what visitors will experience.
Conclusion
The Time Greeting Block brings a simple but effective personalization feature to WordPress websites. By automatically adjusting greetings based on the time of day, it helps create a more welcoming and dynamic experience for visitors. Whether you’re running a business site that needs to reflect operating hours or a personal blog that wants to feel more engaging, time-based greetings add a thoughtful touch that visitors notice and appreciate.
The plugin’s flexibility in implementation — through blocks, shortcodes, or page builders – means it can work with virtually any WordPress setup. Combined with extensive customization options and clean, accessible code, the Time Greeting Block provides a professional solution for adding dynamic, time-aware content to your website.







