I need to determine when AdRotate has a valid promo running; if it does, I display a banner on a listing page.
My code works fine when the AdRotate shortcode is in place. However, even when the AdRotate ad is not running, a value is seemingly being returned, thereby triggering my conditional to display a banner when there’s no promo running. Is there a way of returning no value (null) from the shortcode when there is no scheduled promo running?
Correct. My inquiry surrounds the “a notice why the advert can’t show.”
The actual content within the AdRotate ad appears on a detail page. What I’m attempting to do is to display something like “Special Offers” on a category listing page that links to that detail page. The conditional that determine whether there is an active ad is looking to see if there is a value returned. As there is something returned no matter whether an ad is active or not, that is the problem I am attempting to overcome. If there was a way to turn off the value which is a notice why the advert content cannot show, or determine what that value is, I could then use that for my logic for the “Special Offers” banner on the listing page.
Privacy & Cookies Policy