Here's my code:
{home_featured_sponsor limit="1" search:date_field format='%U'=">={current_time format='%U'}"}
blah
{/home_featured_sponsor}
I'm basically setting up a matrix field where the client can add a featured sponsor in each row and give an expiration date as to when the sponsor is no longer featured. This allows them to load up the Matrix field with sponsors in advance, give expiration dates so they don't need to be changed manually.
Right now the conditional isn't working as it always shows the first one with yesterday's date. I remove the limit="1" and all of them show. I've tried variations of brackets with and without quotes around the custom date but haven't had much luck. I'm just not sure how to handle the format= after the date custom field in the conditional.
Thanks for any help you can give!
-Steve
-
Hi Steve,
You should just be able to do this:
{home_featured_sponsor limit="1" search:date_field=">={current_time}"} -
-
Looks like I was making it far more complicated than I needed to! Works perfectly!
Thanks! -
Loading Profile...


Twitter,
Facebook, or email.

EMPLOYEE
