Conditional tags inside the Sidebar and Ad Rotator Widget
-
Hey gang, I’m hoping somebody can help me with a little issue I’m having. I’m using Kpumuk’s Ad Rotator plugin. What I’d like to do is write a conditional phrase inside the Ad Rotator widget to tell it which ads to rotate on which pages. Something like this:
<?php if (is_page('Contact')) { ?> This would be the Ad I'd display on the contact Page <?php } elseif (is_page('Quote Request')) { ?> This would be the Ad displayed on the Quote Request page <?php } else {} ?>
For some reason my sidebar doesn’t recognize the is_page, is_category, or any other page identifier and I’m not sure why.
If I run a test like ‘<php if (is_page(‘Contact’)) echo (‘This is the contact page’); ?>’ it puts that text in the sidebar of every page, obviously not recognizing that the other pages aren’t the Contact page. Is there some reason the sidebar doesn’t recognize what page I’m on?
Any help would be GREATLY appreciated
- The topic ‘Conditional tags inside the Sidebar and Ad Rotator Widget’ is closed to new replies.