• hey – just upgraded to the new version of php-exec plugin and put some php code into a text widget for my blog. I have a loop that seems to be causing some problems that I didn’t have in the older version of the plugin. Here is the code:

    <?php
    while ($i < 10) {
    $randnum = rand(1, $x) -1;
    if (!in_array($randnum, $numarray)) {
    $numarray[$i] = $randnum;
    $i++;
    }
    }
    ?>

    The code works fine when you look at the website, but now when i click on the widgets option in the admin panel it freezes up.

    The only way I can view my widgets again is to disable the php-exec plugin, go back to widgets and remove the loop.

    Any ideas as to what is causing the widget panel to freeze with loops?

Viewing 1 replies (of 1 total)
  • I would suggest instead of using the text widget to include php, you should just put the php directly in the template in your theme directory for your sidebar.php.

Viewing 1 replies (of 1 total)

The topic ‘Loop inside new php-exec plugin freezing widgets?’ is closed to new replies.