Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Atahualpa 3 Wordpress theme (http://forum.bytesforall.com/forumdisplay.php?f=2)
-   -   Ad Rotator Code in Horbar1 (http://forum.bytesforall.com/showthread.php?t=674)

TikiBoy Mar 7, 2009 02:45 AM

Ad Rotator Code in Horbar1
 
I am trying to insert rotating ads into Horbar1 and I keep receiving "Parse Error Line 183" messages. I am using the Ad-minister plugin which works fine if I place the code on line 1 of bfa_header_config.php, but generates the parse errors if I insert it between <div class="horbar1"> and </div> as instructed.

The code I am trying to use is
Code:

<?php  do_action('ad-minister', array('position' => 'Top
ad'));
?>

which is the minimum code suggested by the authors of the plugin.

Any suggestions are appreciated!

Flynn Mar 7, 2009 05:04 AM

That's due to the single quotes before and after the code, they'd need to be closed. Additionaly you'd need to capture the output of that code first as it seems to print output right away, but bfa_header_config.php is collecting the different parts of the header first, so that you can arrange them on the theme options with the %bar1 etc. placeholders.

Change, i.e.
PHP Code:

 if (strpos($header_items,'%bar2')!==false) {
// Horizontal bar 2
$horizontal_bar2 '<div class="horbar2">&nbsp;</div>';
// END of Horizontal bar 2


to
PHP Code:

 if (strpos($header_items,'%bar2')!==false) {
// Horizontal bar 2
$horizontal_bar2 '<div class="horbar2">';
ob_start(); 
do_action('ad-minister', array('position' => 'Top ad')); 
$top_ad ob_get_contents(); ob_end_clean();
$horizontal_bar2 .= $top_ad '</div>';
// END of Horizontal bar 2



TikiBoy Mar 7, 2009 10:00 AM

Thank you Flynn! Your solution did the trick.


All times are GMT -6. The time now is 01:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.