Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Ok this is a stupid question, and I'm not sure I even asked it right, but this is what I'm trying to do.

My wordpress theme supports ad placements and I want to use a advertising manager plugin. I know I can just go through the theme and replace the ad code that's currently there with code from the plugin. However, the theme does some other stuff with ad placement in between posts etc (that I'm not really sure whats involved to preserve). So I'm hoping there is an easier solution.

If I put the php code from the plugin into the ad placement boxes from the theme, all it does is this in the source of the page (basically comments it out).

<!--?php if( function_exists( 'pro_ad_display_adzone' ) ) echo pro_ad_display_adzone( 1 ); ?-->

This is the code from the theme template file that displays the ad

 <?php echo $con_single_ad_post; // ad ?>

Any ideas how I could get this to work?

share|improve this question
    
Are you putting the php into some sort of custom option field or the actual template file? Also can you post what you are actually pasting. –  Wyck Oct 11 '11 at 19:52
    
Yeah, its a field in the theme options. It says you can post HTML (not php obviously). <?php if( function_exists( 'pro_ad_display_adzone' ) ) echo pro_ad_display_adzone( 1 ); ?> –  Mike Oct 11 '11 at 20:08
add comment

1 Answer

Since actual output seems to be done via echoing global variable nothing prevents you to change that variable to something else (between the points where theme creates and echoes it). Like a result of advertisement manager function call.

However I think it would make more sense to stick with one of two functionalities rather than trying to mash them together.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.