Php in widget issue!
-
Hello!
Code in a template runs in the global context. Code in the widget will run in a function context. Make sure that you declare any global variables as global before attempting to use them”
What does that mean?
How do i configure the code below to work in my widget that can handle php?<?php $lunch = get_group('lunch'); foreach($lunch as $lunch){ echo '<span class="lunch-dag">' . $lunch['lunch_dag'][1]. '</span><br />'; echo '<span class="lunch-matratt">' . $lunch['lunch_matratt'][1]."<br />"; echo $lunch['lunch_matratt'][2]."<br />"; echo $lunch['lunch_matratt'][3]."<br />"; echo $lunch['lunch_matratt'][4]. '</span><br /><br />';}?>
The code works perfect in a template!
Best regards
Andy
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Php in widget issue!’ is closed to new replies.