[Plugin: Random / Rotating Ads V2] Can template code be used via functions.php?
-
I’m an trying to determine if I can use the template codes for various ad groups in my functions.php file and add them to an action hook rather than in a template. I’d like to deliver the ad groups via a conditional if(is_page(‘pagename’)) $ads=’template code’; sort scenario.
Is this possible? I can use the following function to deliver static images to these pages. Is there a way to user the template code in place of the image names?
function aside_ads(){?> <div id="asideads"> <?php if (is_page('about')) $banners='banner_abt.jpg'; } elseif ( is_page('it-managed-services') ) { $banners = 'banner_man.jpg'; } ?> <img src="<?php echo bloginfo('wpurl') . '/wp-content/themes/uploads/' . $banners; ?>" /> </div> <?php } add_action('thematic_abovemainasides','aside_ads');
The topic ‘[Plugin: Random / Rotating Ads V2] Can template code be used via functions.php?’ is closed to new replies.