WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

Your Answer


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.