Show / Hide Content Based on Day / Time

Jan 20, 2022 | WordPress Wednesday

The #Divi theme in #WordPress has display conditions inside of the advanced tab. This allows you to show / hide text, images, links – any module based on a day or time, a users’ status, or even the section of the website they’re viewing.

WordPress has conditional display statements that normally require extra plugins or developer code. The Divi Theme lets you do that out of the box.
Get your copy here
(affiliate link – thank you for sharing the love!)

– Hey, y’all. My name is Kori Ashton, and you have found a YouTube channel dedicated to all things, WordPress. And for many of you, you’ve been following me for a while now. And I am just in love with the Divi theme. And that again brings us this week’s tutorial. We’re gonna be looking at conditional logic. All of this is already inside of your Divi theme. There’s no extra costs, no extra code that you have to add. I’m gonna show you right now, easily, how to toggle on or off content based on a time and a day of the week. So the quick example I’ll give you is perhaps you have a podcast and you wanna show that you’re streaming live right now, asking folks to come join you. You can change that language on your website. Maybe you’re a church and you’re live streaming right now. You can change that language and provide the right link, right then in the moment on your website. Let me show you what I’m talking about. All right, so for the sake of this tutorial, I’m using a faith-based organization, like a church that might want you to join their virtual service. So throughout the week, you can have anything advertising here, you know, so that people will sign up and subscribe. But the idea would be maybe for you to have a button that appears here when we are actually live right now. So, I love that idea. So let’s go in here. We’re gonna enable the Visual Builder. You see up at the very top up here, because I’ve already logged in as an admin, I have rights to this website where I’m able to come access the admin area. Because I’m running the Divi theme, I’m going to be using the Divi builder, which makes WordPress so much more easy. So what I wanna do here is I wanna change the language here. Instead of saying, watch virtually, we want to say, Sign up For Updates, right? Sign up For Updates. And they can use that link now to sign up for updates, right? But if I’m live right now, I really would love for this to say, Join Us for Live. All right, so I’m going to add in a button module, and this is going to say, We’re Live Join Now, right? That’s really what I want this to say. And you can add in the link then over to your Facebook feed or your YouTube feed or wherever you are streaming. And in the design, I’m going to move this to the center to kind of align it underneath that other button. And then the power of Divi.

Y’all here you go. Let’s move into the Advanced tab. You’re going to look for a section here called Conditions. We’re gonna open that up and now we’re going to harness the power of Divi using conditional logic, Display Conditions. So if I open this up, there’s all sorts of different things that we can do to have conditional logic to hide or display something. Thankfully, they included a time and date interaction sitting here. So if I choose Time & Date, I can open that up. The first option here says Display Only if Current Date is After. And of course, if you were running a special or maybe you have something where you have an event that you want to be advertising, this could be set to appear and disappear in that timeframe. For us, though, what I wanna do is actually use on a specific day of the week, right? And that’s gonna be on a Sunday. If you had a podcast running and you had it on Tuesdays at 1:00 PM central, you could do all of that as well. This does play off of your website’s date settings. So, if you stick around to the end, I will show you how to look at that to be sure it’s set up correctly with your time zone. For now, of course, this service is not all day long, so we’re gonna remove that. This is set up on military time, so we’re gonna use 11:30 AM until hour 12, and do 30 here. And this does repeat, and it repeats the frequency of every single week, and it’s not gonna end.

So again, all of these different options that you can pick and choose from and really customize the experience here. And of course you wanna have this one Enable Condition. We want to enable that, right? And we’re gonna go ahead and check that box. And now I just want to make you aware that if you are running any sort of a caching plugin, or if your specific server, maybe your hosting company, has a caching plugin running on your website to speed up the website, that could actually conflict with how this displays, right? Because running a caching plugin actually saves an instance of your website on a previous visitor’s cache, right? So here’s what we wanna do. It says, if you’re using a caching plugin, this page should be excluded from that cache system, right? And that’ll allow this condition to actually function properly. So if you don’t know what all that means, you might wanna reach out to your hosting company and just confirm. You can also test this, though. I’m gonna go ahead and check. Yes, save it, right? And you still see the button here. You’re seeing that because we’re logged in. Let’s go ahead and save what we’re up to. I’m gonna click save. And as soon as I exit up here at the very top, again, you should actually see that button disappear because right now, as I’m recording this, according to my computer, it’s not Sunday.

So there you go. It’s gone. And the only way to really test that is to come back here on a Sunday and see that button go live. For those of you who are interested in figuring out how to double-check on the timing of your website, just to be certain that it’s sets to the correct time zone, I want you to jump if you would please into your Dashboard. So let’s go in the behind the scenes of your website. We wanna go in to Settings and you’re gonna go in to General. And then you’re gonna scroll down to the Date Format and the Time Format and your time zone, right? So be sure that all of these are sitting here correctly. And what day of the week you want it to start on. This is a set it one time and forget it type of engagement here. So if you check this and do it once, you’re sure that it’s correct, it’ll impact everything else that happens on your website when it comes to things that are timed. And especially when you’re thinking about publishing something or turning something on and off.

Hey, y’all, I know this was a very quick tutorial, but I hope that it has helped you. And I hope that it inspires you to get creative with how you can use conditional logic. This can display if your user is logged in or logged out, or if they are on your blog area. Maybe you want to only show a subscribe option inside of your blog area and not on your other information base pages. All of these things are totally possible inside of that one area in your Divi theme. Remember also that you have support from the Divi creators over at Elegant Themes if you have a valid license right now. And if you have any other questions that I might be able to help you with, please be sure to leave them in the comments below and I will try to get to them. All right, y’all. I hope you’re doing really well and staying safe out there. I will see you next week. Be sure to like, and subscribe. I’ll see you later. Bye, everyone.


Hey Y’all – Thanks for watching. Each week I’m creating videos just like this one to help you improve your online marketing. Be sure to subscribe so that you get access to each video. If you have questions about a process, product, or service that I’ve mentioned in a video, please reach out directly to the authors of that item first. If there’s a question about something specific I’ve shared, comment in the thread and I’ll reply within a day or two.

To get my attention more quickly Tweet me @KoriAshton

From freelancer to entrepreneur to c-suite, Kori Ashton has spent over twenty years in the digital marketing space. She built up a WordPress agency that sold in 2017 and spends most of her time now consulting with industry brands and agencies on improving your customer retention with persona-driven development.

WordPress Wednesday –

SEO Tips & Resources –

Beginner WordPress –

Gravity Forms –

Kori’s Toolbox –


***** WEBSITE:
***** SHOP:
***** TWITTER: